A federal judge in New York who ruled that banks must comply with subpoenas from House Democrats has a history of donating to Democrats, including Congressmen and women who sit on the House Financial Services and Intelligence Committees.

U.S. District Judge Edgardo Ramos, who was appointed by President Barack Obama, said in his ruling on May 22 that the subpoenas, which seek records about Trump, his three oldest children, and their spouses, have “a legitimate legislative purpose.”

Ramos, who like all judges had an opportunity to recuse himself if there was an appearance of bias, has donated to Democratic officials, including two that sit on the committees seeking information about Trump.

Federal election records show that Ramos donated $350 in 2008 to Jim Himes for Congress. Rep. Himes (D-Ct.) currently sits on the Intelligence and Financial Services Committees.

Ramos donated $500 in 2010 to the re-election campaign for Rep. Nydia Velazquez (D-N.Y.). He had also donated $250 to her 2005 campaign. Velazquez currently sits on the Financial Services Committee.

Ramos also donated $4,025 to Obama’s first campaign for president in addition to donating $1,000 to the 2007 campaign of Hillary Clinton, who was running against Obama at the time. Trump beat Clinton in 2016.

His other donations include $1,000 to the Senate campaign of Kirsten Gillibrand (D-N.Y.), a $500 donation to Friends of Chris Dodd, a former Democratic Senator, and additional money to Obama’s campaign for re-election.

Ramos halted donations after being appointed by Obama to the federal court in 2011. Federal judges are supposed to be impartial but many have ruled against Trump only to see their rulings overturned by higher courts.

The donations came to light after another recent ruling against Trump.

U.S. District Judge Amit Mehta said in a 41-page opinion on May 20 that Mazars USA, Trump’s former accounting firm, must comply with a subpoena from Congress and turn over financial records from as far back as 2011.

The subpoena asked for records relating to Trump and various associated businesses and entities, citing Trump’s former lawyer, Michael Cohen, who claimed that Trump would regularly inflate financial statements submitted to banks while deflating the value of certain assets in other cases.

Congress essentially has free reign to investigate the president, Mehta wrote in his opinion (pdf).

Mehta was appointed by Obama to the court in 2014.

Federal election records show that Mehta donated to Obama’s first campaign in 2007 and added several thousand dollars in 2012 to Obama’s campaign for re-election.

Mehta also appeared to halt political donations after being appointed as a federal judge.

Trump has noted the background of some judges ruling against him, hitting at Mehta specifically after the ruling.

“Well, we disagree with that ruling. It’s crazy—because you look at it; this never happened to any other President. They’re trying to get a redo,” he said, referring to special counsel Robert Mueller’s Russia investigation, which ultimately found no evidence of collusion between the Trump 2016 presidential campaign and Russia. Throughout the nearly two-year investigation, Democrats leaned heavily on an expectation that Mueller would find collusion.

“They’re trying to get what we used to call in school: a deal—a ‘do-over.’ And if you look, you know, we had no collusion, we had no obstruction. We had no nothing. The Democrats were very upset with the Mueller report, as perhaps they should be,” he said in Washington before departing for a rally Pennsylvania.

“But, I mean, the country is very happy about it because there was never anything like that. And they’re trying to get a redo, or a do-over, and you can’t do that. As far as the financials are concerned, we think it’s totally the wrong decision by, obviously, an Obama-appointed judge. He was a recent Obama-appointed judge.”

Trump’s legal team filed an appeal after Mehta’s ruling.