The Democrat who barely lost Tuesday’s Ward 25 aldermanic race to incumbent Republican Nancy Ahern said Thursday that he may file a lawsuit contesting the results.

The candidate, Anthony Wallace, said he will ask a judge to overturn the election if an automatic recount scheduled for 1 p.m. today does not put him into office. Ahern — one of only two Republicans on the city’s Board of Aldermen — beat Wallace in the Westville ward by a mere three votes.

Wallace, an attorney, said he plans to challenge several absentee ballots because of an alleged irregularity in the way they were delivered from the post office.

A recount is also scheduled for Friday morning in Ward 8, where Green Party candidate Bruce Crowder lost to incumbent Democrat Vincent Mauro Jr. by only 15 votes.

Connecticut election law requires recounts for all contests in which the margin of victory is less than 20 votes.

Following Tuesday’s upset in Ward 2 by Green Party candidate Joyce Chen ’01, the two recounts — and the possibility of a lawsuit — may pose problems for the Board of Aldermen as it attempts to determine who will serve as its minority party.

If Ahern retains her victory through tomorrow’s recount and the potential lawsuit, the Greens and GOP will have two seats each, forcing them to reach an agreement on the fate of the board’s minority caucus.

The business of the Board of Aldermen is structured around a two-party system composed of majority and minority caucuses. Jorge Perez, the president of the Board of Aldermen, said Thursday that the board’s rules do not support multiple minority leaders.

“They’re just going to have to lock themselves in a room and elect a single minority leader,” he said. “That’s the only thing they can do.”

If they fail to elect a minority leader, Perez said the two parties would lose out on many important agenda-setting processes.

If the recounts change the results or Wallace is successful in his challenge, however, the issue will be moot.

Under Title 9 of the Connecticut General Statutes, which governs elections, Wallace has until Nov. 20 to file his suit.

“There are specific votes that I’m challenging that shouldn’t have occurred,” said Wallace, who lives at 18 West Elm St. “If those votes are found illegal, that will challenge the winner.”

Wallace said he will challenge the way the absentee ballots were delivered from the post office to the city registrars’ office.

“The statutes are very, very specific as to who can do what and as to who can pick up the ballots at the post office,” he said.

Wallace said he believes an unauthorized person may have delivered the ballots.

Mary Young, a staff attorney with the Connecticut Secretary of the State’s office, said suits like Wallace’s are not very common.

“We have them maybe once or twice an election, sometimes not at all,” Young said Thursday. “It doesn’t happen too often because there’s a cost involved.”

Young said Connecticut does not see many lawsuits because state law requires so many automatic recounts. Tuesday’s election has spawned recounts this week in 40 or 50 towns and cities across the state, she added.

Sharon G. Ferrucci, New Haven’s Democratic registrar of voters, said recounts have rarely changed the outcomes of city elections during her tenure.

Wallace is allowed to send a nonparticipating observer to today’s absentee ballot recount to take notes for use as evidence during a court hearing.

If a judge determines that there were problems on Tuesday or with today’s recounts, he may order another recount or even a new election.