There were insults. There were accusations. And then there was a last-minute change to a last-minute change of candidates just hours before the Republican City Committee chose a new chairman Monday evening.

In the end, Michael Meehan, the local party's longtime general counsel, defeated a lone rival for the chairmanship.

"Whether you voted for me or not, I don't care," Meehan told the ward leaders at the United Republican Club in Kensington after the vote, asking them to pull together for an upcoming party fundraiser.

Meehan, the son and grandson of former Republican Party officials, briefly dropped out of the race over the weekend and threw his support to Joe McColgan.  But on Monday, he reentered the election just in time to win it.

Michael Cibik, who became acting chairman of the local GOP when Joe DeFelice resigned Friday, upended McColgan's candidacy Monday morning, claiming he was ineligible to be a candidate and accused him of trying to pull a fast one.

McColgan at first dismissed Cibik's claims as comical and compared him to a whining toddler.  A few hours later, McColgan dropped out of the race and threw his support to Meehan.

Meehan defeated Cibik, 65-55, in a weighted election system that gives wards with a higher percentage of Republican voters more sway in balloting.

The election, Cibik said, came down to the last vote and a ward leader he had expected to support him who instead went with Meehan.

"I got screwed," said Cibik, leader of the Fifth Ward in Center City. "Welcome to Philadelphia politics, I guess."

Cibik had noted before the voting that McColgan resigned earlier this month from the Pennsylvania Intergovernmental Cooperation Authority, a state agency with oversight of the city's budget.

The state law that created PICA says, "Members of the board and the executive director shall not seek election as public officials or party officers for one year after their service with the authority."

McColgan, who previously ran for the U.S. House of Representatives and City Council, said he decided to withdraw Monday afternoon to avoid "a sloppy fight, a messy fight."

The Cibik-Meehan face-off was a revival of an old party feud.  Meehan hails from the GOP's old guard. Cibik was part of “the Loyal Opposition,” a group that warred with the Republican City Committee from 2009 to 2013 about making the party more competitive.

Meehan, 60, said he had been written off as "from the past" by Cibik and his supporters. He noted that Cibik is 74.

"I hardly believe a septuagenarian is the future," Meehan said.

Cibik has 13 months left on his term as the party's vice chairman.

"Mr. Meehan will have to work with me," he said after the vote.

Before the election, Cibik had claimed McColgan's brother-in-law, Val DiGiorgio, who was elected chairman of the Pennsylvania Republican Party in February, had been pushing for his election.

Cibik said he rejected a request Saturday from the state party to have its general counsel, Joel Frank, attend and observe Monday evening's election.

"There's no good that comes of that," Cibik said. "Val DiGiorgio has his thumb all over this election.

McColgan has said his brother-in-law was not involved in the local race.

"I've kept my distance between the state chairman and myself," McColgan said before withdrawing.

DiGiorgio said the state party fielded phone calls and emails over the weekend from Philadelphia ward leaders asking for an observer to make sure the election is "fair and impartial."

"That's about the extent of my involvement," DiGiorgio said. "Our only concern is that this happens fairly."