BAGHDAD (Reuters) - Iraq’s top court upheld on Thursday a law mandating a nationwide recount of votes in a May parliamentary election but ruled that the cancellation of overseas, displaced, and Peshmerga ballots was unconstitutional.

Slideshow ( 3 images )

Iraq, OPEC’s second largest oil producer, faces political uncertainty after the election, which was marred by a historically low turnout and allegations of fraud.

Parliament, which had mandated the recount after a government report found serious violations had taken place, had also canceled some results such as overseas and displaced votes by amending the election law this month.

The verdict from the Supreme Federal Court confirms the recount process, which was opposed by the elections commission and some parties who made significant gains in the election.

“The Supreme Federal Court finds that parliament’s decision was to organize the electoral process and restore voter confidence in the electoral process; it was within parliament’s constitutional rights and does not contradict the constitution,” said Chief Justice Medhat al-Mahmoud

Attending lawmakers cheered as Mahmoud read out the verdict.

The recount process has already begun after judges took over leadership of Iraq’s Independent High Elections Commission. The verdict is final and not subject to appeal.

The court was tasked with ruling on the matter after the law amendment was challenged by Iraq’s president, the election commission chief, and a Kurdish party on multiple grounds.

“This cancellation ... presents a squandering of votes and confiscation of the will of voters in these areas which violates constitutional articles that guarantee the right to equality and voting,” said Mahmoud.

The amendment had stipulated that votes by Iraqis abroad, those displaced in the war against Islamic State in Sunni Arab provinces, and security forces in the semi-autonomous Kurdistan Region would be canceled.

The remainder of the election law was constitutional, the chief justice said.

Plaintiffs had claimed the amendment was unconstitutional because it was passed by a parliament in which most lawmakers failed to retain their seats. The court said the current parliament’s term has not expired yet and thus it was within its rights to legislate.

Nationalist cleric Moqtada al-Sadr and Iranian-backed militia chief Hadi al-Amiri, who won first and second place respectively in the polls, have announced an alliance between their political blocs.

But the formation of a new government is still a long way as parties engage in the traditional horse trading that follows Iraqi elections as they wait for the results to be formally ratified after the recount.