Gov. Andrew Cuomo has issued his first state Senate endorsement of the campaign season, and it’s going to a Democrat (!) against whom he turned in a hotly contested June 26 congressional primary battle.

The lawmaker in question would be Sen. Adriano Espaillat, who lost his bid to oust veteran Rep. Charlie Rangel this summer.

“I am proud to endorse Senator Adriano Espaillat for re-election based on his strong record of supporting tenants, expanding opportunities for immigrants, and advocating for policies that helped restore New York State’s status as the Progressive Capital of America,” Cuomo said in a press release.

“Adriano has been an important partner in making New York State’s government work for the people again, and we need him to continue serving in the Senate as a strong progressive fighter. I urge voters in the 31st Senatorial District to join me in supporting Adriano Espaillat and sending him back to Albany.”

With days to go before the Espaillat-Rangel showdown, Cuomo announced he had chosen to support the embattled veteran Harlem congressman. And it turned out that Cuomo bet correctly, since Rangel defeated Espaillat – and his four other Democratic opponents – although the race between the senator and the congressman was pretty close.

Now thanks to a quirk in the election calendar (and the Legislature’s inability to come to an agreement on moving their own primaries to coincide with the court-ordered congressional contests), Espaillat is fighting to keep his current job.

He’s being challenged by his on again/off again political frenemy Assemblyman Guillermo Linares, who has Rangel’s support.

The primary is next Thursday Tuesday. (Sept. 13). The Legislature moved it back from Sept. 11 to avoid coinciding with the anniversary of the Twin Tower attacks.

Cuomo had said he would make Senate endorsements on a case-by-case basis, and has declined to take sides in the re-match between his fellow Democrats and the Republicans for control of the majority.