Buffalo Mayor Byron Brown has no chance of appearing on the general election ballot in November now that appeals courts from both the state and federal levels have chimed in.

In June, Brown lost the democratic primary to political newcomer India Walton by about 1,000 votes.

Brown initially announced he’d stay in the race as a long-shot write-in candidate. But his campaign changed course when Brown and supporters filed legal challenges in state and federal courts to the state law that moved up the filing deadline for independent candidates to May 25, before the primary.

On Sept. 3, Erie County Supreme Court Judge Paul B. Wotjaszek declared the state law unconstitutional and therefore directed election officials to add Brown’s name to the Nov. 2 ballot under a new independent line the “Buffalo Party”

That same day, U.S. District Judge John L. Sinatra Jr. also declared the state law unconstitutional, despite concerns of potential conflicts swirling around him, which gave Brown two legal victories in one day.

On Thursday, those victories turned to defeat.

The Fourth Department of the state appellate court in Rochester reversed Wotjzaszek’s decision, while the United States Court of Appeals for the Second Circuit in Manhattan granted a stay on Sinatra’s order.

As a result, the Erie County Board of Election on Friday certified the mayoral general election ballot without Brown’s name on it.

News 4 Investigates interviewed two legal experts who put Thursday’s court action into perspective.

In the state appeals court’s unanimous ruling, the panel said that a “reasonably diligent candidate” could be expected to meet New York’s requirements for independent candidates to secure a spot on the ballot and because those requirements do not unfairly discriminate against independent candidates, “we conclude that Election Law places only a minimal burden on the constitutional rights of those candidates and their votes.”

The state appeals panel also noted that as Brown seeks his record fifth term, he is “far from the archetypal ‘independent candidate’ whose interests” are protected by prior court decisions and laws.

“The judges on the appellate panel are telling Mayor Brown and his supporters that they had their opportunity under New York state law to run in the primary for the Democratic nomination, and when they chose to take that fork in the road rather than the independent nomination fork in the road, that was a choice that was irreversible,” said James J. Sample, law professor at Hofstra University.

“Once the deadline has passed and you have not succeeded in a party primary that you decided to run in, there’s essentially no second bite at the apple,” Sample said.

The legal term for what Brown attempted to do is referred to as a “sore loser.”

The state appeals panel noted that there are several legitimate state interests that would justify the state legislature changing the deadline for independent candidate, including to promote political stability at the expense of factionalism, upholding the state’s duty to meet federal deadlines for mailing overseas and military ballots and to ensure the integrity and reliability of the electoral process.

“This was a strategic choice made by Mayor Brown and his strategy did not pay off,” Sample said.

James Gardner, a law professor for University at Buffalo who specializes in election law, said the federal appellate court’s stay means that the panel could still review the merits of the lower court’s decision, but “it would not affect this election; it would affect future elections.”

Gardner said there is a presumption in the law that deals with elections: “That we try not to change the rules at the very last minute.”

“And this is a very good reason why,” Gardner said.

Brown said Friday that his campaign will focus on his write-in candidacy.

“We’re not going to appeal the ruling,” Brown said

“We don’t think that there is a enough time before military and absentee ballots have to be sent out and we don’t want to disenfranchise those voters.”

Meanwhile, Walton, while accepting the endorsement from Workers United of Upstate NY, said the mayor’s court battles have drained “a lot of our resources in the process.” She said the court cases have cost her campaign tens of thousands of dollars to fight.

“He’s trying to bleed us dry through stunts like those over the last few weeks,” Walton said.