The court found on Thursday that the decision by parliament to order a manual recount in response to allegations of electoral fraud does not violate the constitution, court President Medhat al-Mahmud told a news conference on Thursday.
The verdict is final and not subject to appeal.
The country's outgoing 328-seat parliament voted on June 6 in favour of the manual recount of all the 11 million ballots after allegations of irregularities in the electronic voting system.
MPs had also sacked a nine-member Iraq's Independent High Elections Commission that oversaw the process and replaced the body with judges. The recount process began shortly after the judges took over leadership of the commission.
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.
The court decision also ruled that the annulment of some results such as overseas and displaced votes was unconstitutional. These votes will again be counted towards the final election result unless evidence of fraud is submitted.
Setback for Sadr?
The move could undermine Sadr, a long-time adversary of the United States who also opposes Iran's influence in Iraq and whose bloc won the largest number of seats in the election.
The Shia leader has strengthened his parliamentary position since the vote by forming an alliance with two other lists.
The former militia leader reached a coalition agreement on Thursday with Shia Ammar al-Hakim's Al-Hikma list and the secular outgoing Vice President Iyad Allawi, whose list was comprised largely of Sunnis.
His strengthened bloc gives Sadr around 100 seats, but fell short of 165 seats required to form the government.
Iraq's political system is designed to ensure that no one person or party can dominate, leading to extended post-election horse trading between multiple factions - a process that hasn't been interrupted by the order for a recount.