Republican New York Rep. Richard Hanna, who announced Tuesday he would be breaking ranks this November and voting for Hillary Clinton, has a lengthy history of siding against his party and standing with with one of Clinton’s staunchest allies — Planned Parenthood.

Planned Parenthood donated thousands of dollars to Hanna’s campaigns in 2012 — when he was one of three Republicans in Congress to accept money from the organization — and in 2014, when he was the only Republican in Congress funded by Planned Parenthood.

Hanna, whose office has yet to return a request for comment, has consistently opposed Republican legislation that would regulate abortion — even in instances where public opinion supports such regulation — and has repeatedly fought against efforts to defund Planned Parenthood.

This past September, he was one of just three Republicans who voted to continue funding the organization. Republican presidential nominee Donald Trump has vowed to strip Planned Parenthood of all taxpayer funding if elected.

The cozy relationship between Planned Parenthood and Hanna is a two-way street.

Planned Parenthood Action Fund, the organization’s lobbying arm, contributed to three Republican congressional candidates in 2012. According to the Center for Responsive Politics, Olympia Snowe and Susan Collins (both Republican senators from Maine), received a combined $274 from Planned Parenthood Action Fund. Richard Hanna took in $4,383.

In October 2011, one month after PPAF wrote a $2,000 check to his campaign, Hanna voted against an amendment to the Affordable Care Act that would prohibit taxpayer funds from going to insurance plans that cover abortion. Of the 238 House Republicans to vote on the bill, only two (counting Hanna) voted against it.

In May 2012, Hanna was one of seven House Republicans to vote against the Prenatal Nondiscrimination Act, which prohibited a abortions on the basis of the unborn baby’s race or gender. A poll released two weeks prior to the vote found that 77 percent of Americans approved of a ban on sex-selective abortions.

In 2014, PPAF donated to just one Republican congressional campaign: Hanna’s. PPAF donated $2,823 to Hanna’s campaign, roughly triple what it gave to House Minority Leader Nancy Pelosi, a Democrat from California. The organization even put out a press release congratulating Hanna on his primary victory.

Hanna, who is retiring at the end of his term, announced Tuesday that he will support Clinton over Trump in November.

“Mrs. Clinton has promoted many of the issues I have been committed to over the years,” he wrote in an op-ed explaining his decision, “including expanding education and supporting women’s health care.”

Follow Peter Hasson on Twitter