City Council President Michael Helfrich won election as York mayor at the ballot box on Tuesday.

It's possible he could have to defend his victory over two-term incumbent Kim Bracey in court.

Helfrich, a Democrat running on the Republican line, defeated Bracey who ran on the Democratic line, and Libertarian Dave Moser.

An updated tally on the county Board of Elections website Wednesday morning showed Helfrich with 2,128 votes to Bracey's 2,003 votes and Moser's 64 votes.

More:Michael Helfrich defeats Kim Bracey in York mayor's race

Tuesday night after the polls closed and Bracey had conceded, she didn't rule out the possibility of a court challenge to Helfrich's legal eligibility to serve as mayor.

Helfrich pleaded guilty to two drug-related felonies sterming from the same incident 26 years ago when he was in his 20s.

"That's not going to be up to me but there may be some concerns about it," Bracey said.

Bracey pledged to work with Helfrich in the transition between their two administrations.

More:Mayor Bracey: Thank you, York (column)

If Helfrich's ability to take office as mayor is challenged, he could face a difficult court battle, according to two legal experts.

In 1991, Helfrich pleaded guilty in York County Court of Common Pleas to possession of LSD with intent to deliver and possession of psychedelic mushrooms with intent to deliver, according to court records.

His convictions were widely publicized in 2011 when he first ran for city council.

After Helfrich won, Bracey, who was in her first term as mayor, sued in York County Court of Common Pleas trying to block Helfrich from taking office.

The case went to Judge Stephen Linebaugh and turned on whether either of the two felonies to which Helfrich pleaded guilty were an "infamous crime" under the Pennsylvania constitution.

Under the state constitution, "No person hereafter convicted of embezzlement of public moneys, bribery, perjury or other infamous crime" can hold elective office in the state.

Linebaugh ruled in August 2012 that Helfrich's convictions didn't constitute infamous crimes and that he was eligible to serve on the city council. Bracey didn't appeal the decision to the state Superior Court.

Linebaugh's decision differed from other Pennsylvania courts that have ruled on the issue, said Adam Bonin, an election law lawyer in Philadelphia.

Other courts, including the state Supreme Court in 2011, have usually held that any Pennsylvania felony conviction constitutes an "infamous crime," barring the person from holding public office, he said.

"The state courts have not been lenient on this," said Bonin, who usually represents Democrats in election law matters. Bonin wasn't involved in Bracey's 2011 challenge to Helfrich's eligibility and hasn't been asked to get involved in any possible case this time, he said.

For his part, Helfrich said a court has already ruled on his eligibility and the issue should be considered settled. But he's prepared to fight in court if a challenge is brought.

"If I can serve on city council," he said. "I can certainly serve as mayor."

But just because a court ruled on a challenge to Helfrich serving on city council, doesn't mean a challenge can't be brought to his serving as mayor, said Bruce Ledewitz, associate dean and professor at Duquesne University School of Law in Pittsburgh.

""This lawsuit would be a completely different lawsuit," Ledewitz said.

The state Attorney General or the county District Attorney have the first opportunity to bring a lawsuit challenging someone's ability to hold office, said Bonin, the election law attorney.

If each declines to do so, any York resident might be able to bring a challenge, Ledewitz said, although he also said the matter is in dispute.

"Discussions of this nature are premature, and our office will have no comment at this time," said Kyle King, a spokesman for outgoing York Count District Attorney Tom Kearney.

More:It's official: Dave Sunday is elected as York County DA

Newly elected York County District Attorney Dave Sunday had no immediate comment. A spokesman for Pennsylvania Attorney General Josh Shapiro had no comment.