WASHINGTON — Rep. Ryan Costello moved to pull his name off the May primary ballot Tuesday, ending speculation that Republican leaders might try to replace the retiring congressman with a handpicked candidate in the fall.

The decision leaves attorney Greg McCauley, a new face to party insiders, as the only Republican on the ballot in the Chester County-based Sixth Congressional District, one that political analysts now see as among the most likely to flip from the GOP to Democrats.

"I don't know the last time I've been so angry," Costello said in an interview, expressing frustration over new congressional boundaries imposed just a month before the deadline to decide whether to run again.

Costello had already said he would not seek reelection this fall, but had filed petitions to appear on the primary ballot. Pennsylvania Republicans had discussed the possibility that he could win the GOP nomination and then drop out, which would allow the party to handpick a replacement.

But Costello said Tuesday it wouldn't make sense to campaign while planning to leave the race later. He said he circulated petitions to run in part to protect the GOP's ability to have someone to run in the district against Democrat Chrissy Houlahan. McCauley now fills that void.

McCauley describes himself as an "economic conservative" and met Monday with Val DiGiorgio, chairman of both the state and Chester County Republican Parties.

"We've got a candidate in the race, Greg McCauley, I think we've got to get to know him a little bit better and [put] a team around him," DiGiorgio said. "We've got some hard work ahead of us." (McCauley also filed a legal challenge to Costello's candidate petition.)

Some Republicans have expressed frustration that Costello, 41, waited until Sunday to announce that he wouldn't seek a third term, days after the deadline for candidates to get on the Pennsylvania ballot.

Costello, however, said that party leaders were aware of his hesitation and that it was an agonizing decision as he considered whether to give up a position he worked for most of his adult life to win. He weighed many factors — life in Congress strained his family, and substantive work was often drowned out by controversy — but said the new district map imposed by the Pennsylvania Supreme Court in late February was "the tipping point."

Costello said he wavered for weeks, and did not want to make an announcement until he was sure. He also hoped that federal courts would block the new map, which would have increased his odds of winning another term.

"There were days when I had my guns a-blazing mentally and said, I'm going to go for it, I don't care, I'm not going to let them screw me," he said. "Then there were days when I felt 100 percent the other way."

The new Sixth District was part of a statewide reconfiguration to replace a map that the court ruled was unconstitutionally skewed to favor Republicans. It is more compact than the old district, and also more favorable to Democrats. Hillary Clinton would have won it by nearly 10 percentage points, compared to a narrow 1-point win under the old lines — though the 2012 presidential race would have produced a much narrower win for the Democrats in the new territory. Half the district's voters are new to the Sixth.

"Overnight I was the single most vulnerable Republican in the country," Costello said.

He again blasted the court decision as corrupt and politically motivated, and said several Democratic justices should be impeached. Numerous legal experts, however, had said the GOP challenges to the map were likely to fail, and dozens of other candidates made quick decisions to run under the new boundaries.

Still, Costello said he "was shocked" when federal courts let the new maps stand.

That was a day before petitions were due. Costello argued that other candidates had easier choices, since many were challengers whose odds of success improved under the new map. He, on the other hand, was an incumbent choosing whether to give up his seat against tougher odds.