Republican Jim Coughlan on Friday dropped his bid for a Hudson Valley state Senate seat and backed Sue Serino as the “best person” to unseat Democratic incumbent Terry Gipson.

Coughlan had come under fire during his campaign for racially and sexually insensitive tweets and retweets — a story that was quickly pounced on by his GOP opponents.

In a statement, Coughlan sounded a defiant tone, but alluded to the “distraction” by “Albany insiders.”

“As we begin the process of circulating petitions, it is more important than ever to rally together rather than tear each other apart for personal political gain. Unfortunately, the relentless attempts made by a select few of Albany insiders to discredit candidates in this race has only served as a distraction in what should be a more honorable process. The people of the 41st Senate district deserve better and its time to start focusing on the issues affecting families of Dutchess and Putnam Counties.

The exit of Coughlan, the Dutchess County comptroller, clarifies what was a crowded primary field.

Serino this month was backed by the Independence Party.

Coughlan had the support of the local Conservative Party in his campaign, but local party officials had said they would review their endorsement following the news about his Twitter use.

“As I have said from the beginning of my candidacy, the ability to unite all three party lines will be crucial to our ability to take back the 41st New York State Senate seat,” Coughlan said. “While I am humbled by the support so many have shown to my campaign over the last several months, I remain committed to this principle.”

Gipson, a freshman running for re-election in the 43rd Senate District, won his race in 2012 thanks in part two a Conservative Party nominee, Neil DiCarlo, dividing a vote with Republican incumbent Sen. Stephen Saland.