As Michael Bloomberg, the billionaire former mayor of New York City, campaigns in the Democratic primary for president, he has been forced to account for his more conservative past. He recently apologized for an aggressive and unconstitutional stop-and-frisk policing strategy that targeted innocent New Yorkers of color. Progressives have criticized him for funneling cash to help endangered Republicans in the U.S. Senate. And derogatory comments about the #MeToo movement are proof for some Democrats that the 77-year-old is out of step with today’s party.

Bloomberg, though, has largely avoided blowback so far on another facet of his political past, one grounded squarely in New York’s thorny political scene: his lavish funding of Republicans in the State Senate. As Democrats have fought in New York and nationally to turn state legislatures blue and build local bulwarks against President Donald Trump, Bloomberg’s decision to donate to the Republicans who once held the majority stands out in a presidential field that has drifted further left.

“His monetary contributions stuck in the craw,” said State Senator Toby Stavisky, a Queens Democrat who served in Albany for all of Bloomberg’s 12 years as mayor. “It was not appreciated. Many in the conference were very unhappy, myself included.”

Bloomberg has been a prolific donor to local and national causes over the years, many of them liberal in nature. He is a remarkably generous giver to organizations that fight for gun control and against climate change. A former independent who campaigned three times as a Republican for mayor, he was ahead of the Democratic Party on social issues like same-sex marriage, which he backed before national leaders like Barack Obama and Hillary Clinton.

But Democrats in New York remember how often his cash stifled them. Stavisky recalled a time when the Senate Democrats, comprised chiefly of lawmakers from New York City, were so incensed with Bloomberg that they refused to meet with him when he came to Albany.

Over his three terms, Bloomberg personally donated more than $2 million to the State Senate Republican’s campaign committee, according to state campaign finance records. $1 million of that came in one fell swoop in September of 2012, when Democrats were close to knocking the Republicans out of the majority. That same day in September, he also donated $75,000 to a campaign committee for the Independent Democratic Conference, a rogue group of Democrats who would partner with the Republicans to lock the regular Democrats out of the majority. (A month later, he would also donate $250,000 to Assembly Democrats, who have controlled the chamber since the 1970s.)

In addition, Bloomberg gave to the State Republican Party, who could easily funnel the cash to Senate Republicans in competitive races, and to local GOP housekeeping accounts. He could single out New York City Republican senators, including Andrew Lanza, Marty Golden, and the late Frank Padavan, who each received at least $10,000 from the billionaire.

Not a single dollar from Bloomberg ever flowed to the coffers of the Senate Democrats’ campaign arm. Occasionally, individual Democrats could pick up a check, like State Senator Joe Addabbo of Queens, who received $10,300 in 2011, likely for providing a crucial vote to legalize same-sex marriage. Bloomberg cut large checks to the few Republicans who took the same vote.

“Even though he didn’t share all or even many of their values, Mike still sometimes offered to help legislators who bucked their party and took hard votes to be on the right side of history,” said Stu Loeser, a Bloomberg campaign spokesman.

Bloomberg’s decision to give and keep giving to the Republicans who would repeatedly thwart the policy aims of progressive Democrats was fueled by a mixture of personal belief and realpolitik, according to both supporters and detractors. It began, in part, to reward the few Republicans who initially backed his long-shot bid for mayor in 2001, like Golden, and later morphed into a belief that the status quo of divided government in Albany best served New York City as well as the particular policy outcomes he sought.

“We agreed with him on so many issues,” recalled John DeFrancisco, a former Republican state senator from the Syracuse area. “The Senate Democrats didn’t want charter schools, the Senate Democrats fought tooth-and-nail against stop-and-frisk. He needed a Republican Senate. It was to his advantage, that split—he had leverage on both sides.”

Loeser, who also served as Bloomberg’s City Hall press secretary, argued that split party rule in Albany yielded strong outcomes for the city. “Mike’s job was to fight for results that mattered for New York City and by any measure he got them when government was divided in Albany,” he said.

Bloomberg had been a registered Democrat before embarking on his first mayoral campaign. He easily won the Republican primary but was expected to lose the general election in heavily Democratic New York, despite the fact he was capable of spending tens of millions on his own campaign. Shortly after 9/11, he won a narrow victory over the Democrat, Mark Green, and set about shoring up relationships with the Republican establishment that had helped him.

Though New York State hasn’t supported a Republican presidential candidate since Ronald Reagan in 1984, Republicans controlled the State Senate, with only one brief interruption a decade ago, from the mid 1960’s until this year. For many years, GOP rule was treated as a fact of life: the party was strong in the suburbs and upstate, some members were more liberal than today, and moderate Democrats, wary of a leftist takeover, enabled Republican control. Each decade, Republicans were able to gerrymander district lines to maintain their majority, even as party enrollment plummeted.

Among those who held liberal views on certain issues, Bloomberg was not alone in being a patron of the Senate Republicans. Several of the major labor unions in the state, including the powerful healthcare workers union 1199 SEIU, heavily funded the Republican majority. Governor Andrew Cuomo, notably, has been hostile to Senate Democrats over the years.

“I think his approach to Albany was a lot like his approach to governing in general. ‘We have to figure out how to get things done.’ You had a Republican Senate you had to work with,” said Chris Coffey, a former Bloomberg aide.

Mayor Bloomberg holds media availability following a meeting with the Senate Republican conference regarding marriage equality legislation on June 16, 2011.

When Bloomberg took office in 2002, the Senate Republicans, with a membership concentrated north of the city, sat in the majority. George Pataki, another Republican, was governor. Governing a city reeling from the September 11th attacks, Bloomberg would need both.

Despite its economic output and influence, New York City must seek permission from state government to raise income taxes, shape the governance of its public schools, strengthen tenant laws, embark on certain major infrastructure projects, and even determine the speed limit on city streets.

Bloomberg immediately sought to centralize the city’s public schools under his control, ending the elected school boards that had dominated the education system for decades. His cozy relationship with Senate Republicans paid off as they allowed him to move forward. Mayoral control of public schools, as its known, has been widely regarded as a success, with Mayor Bill de Blasio, a Democrat otherwise critical of Bloomberg, battling to keep the same structure in intact.

On education, Bloomberg increasingly saw eye-to-eye with Republicans skeptical of traditional public schools. A strong backer of privately-controlled, publicly-funded charter schools, Bloomberg was allowed, thanks to Senate Republican support, to rapidly boost their number in the five boroughs. The city teachers’ union, a traditional Democratic ally, warred bitterly with Bloomberg since charters didn’t have to hire unionized teachers.

In other policy arenas, Bloomberg found agreement with the conservative Senate Republicans. Both were skeptical of the criminal justice reform measures pushed by Democrats, including decriminalizing marijuana, reducing stop-and-frisk, and cutting back on NYPD surveillance of mosques.

The real estate industry, once the premier power broker in Albany, enjoyed a symbiotic relationship with Bloomberg and Senate Republicans. Many of the richest developers in New York traveled in Bloomberg’s social circles.

Bloomberg was unabashedly pro-development, declaring the city a “luxury product” and resisting calls from progressives to strengthen the rent-regulations that Republicans would consistently vote to weaken. Both Bloomberg and the real estate industry’s lobbying arm were top funders of the Senate Republicans.

“There’s a real misalignment of him running in the Democratic primary since for so much of his life and career he’s been actively a Republican,” said Jonathan Westin, the executive director of New York Communities for Change, a progressive group that often clashed with Bloomberg.

Westin, an Elizabeth Warren supporter, said he never expected Bloomberg to offer much help to the Democrats when they were struggling to win a majority over the last decade and a half. “Him trying to buy the Senate Republican majority felt very similar to him spending $100 million on a mayoral election. He was trying to spend whatever it took to buy the elections.”

Bloomberg’s greatest failures in Albany were due to uncooperative Democrats, not Republicans. Sheldon Silver, the longtime speaker of the State Assembly, could be cool to the billionaire’s entreaties. He refused to hold a vote on a congestion pricing scheme and helped kill Bloomberg’s ambitions for a football stadium in Manhattan.

Though the Senate Democrats who served when Bloomberg was mayor may be rooting against him in the Democratic primary these days, Stavisky was unwilling to count him out.

“This is not your normal election,” she said. “So many of us believe we would prefer anybody than the current president.”