U.S. Rep. John Conyers, No. 2 in seniority in the House of Representatives, lost his appeal Friday to get on the August primary ballot after Michigan election officials found problems with the Democrat’s nominating petitions.

The Secretary of State’s office affirmed a decision by Detroit-area election officials to keep Conyers off the ballot. It would end his 50-year career in Congress unless courts intervene or he runs a successful write-in campaign.

A federal judge is expected to rule later Friday on Conyers’ request to throw out a Michigan election law as unconstitutional.