HARRISBURG, Pa. (AP) — A judge is ordering election officials to put the Green Party’s candidate for president on Pennsylvania’s ballot, turning back a court challenge by Democrats just eight weeks before an election in the battleground state.

Democrats had contended that the Green Party’s presidential and vice presidential nominees did not properly submit candidate affidavits in August to go along with paperwork containing voter signatures to get on the ballot. As a result, they said, both must be barred from the ballot.

Commonwealth Court Judge Drew Crompton, a Republican, disagreed and dismissed arguments that the presidential nominee, Howie Hawkins, should be barred from the ballot. An appeal is possible.