(CNN) - A federal judge has ordered Michigan officials to place U.S. Rep. John Conyers back on the state's primary ballot.
State election officials had said the Democratic lawmaker had fallen short of requirements to make the ballot because two people collecting signatures for him were not registered voters, as required by state law.
Conyers, 85, has served in Congress since the mid 1960s, and was planning to seek reelection as a write-in candidate, if his ballot appeal was denied.
The primary is August 5.
The district court order handed down on Friday concluded that Conyers had enough valid signatures to qualify for inclusion on the ballot.
Conyers is the second-most senior member of the House behind Rep. John Dingell, also from Michigan, who announced earlier this year he would retire after serving 58 years.