Bucharest, Romania (CNN) -- Romanian President Traian Basescu will officially return to office after the country's top court ruled Tuesday that a referendum to remove him was invalid.
The nation-wide impeachment effort last month had appeared to be heading for failure because turnout was below 50%.
Prime Minister Victor Ponta made a last-ditch effort Monday to get the Constitutional Court to approve the referendum by submitting new voter lists, but the court said Tuesday the vote was not valid.
Officials said after the referendum on July 29 that just over 46% of registered voters had cast ballots.
Those who did cast ballots voted nearly 9 to 1 to impeach the president, the Central Election Bureau said.
Ponta said Basescu "should strongly consider whether he is still legitimate or not in the office."
Basescu had urged his supporters to boycott the polls, saying, "The best help today is to stay home."
After the polls closed, he said voters had rejected a "coup" by Ponta and the interim president, Crin Antonescu.
Basescu had been suspended since parliament voted to impeach him in early July, saying he overstepped his authority by ordering wage and benefit cuts for public workers.
The legislature is dominated by Ponta's center-left USL party.
Basescu said the austerity measures were needed to meet the terms of a $24 billion loan from the International Monetary Fund for the cash-strapped country, but the move soured many Romanians on his leadership.
Opponents also accuse Basescu of cronyism. He took office eight years ago and has already survived one effort to remove him, in 2007.
Ponta is dealing with his own controversy: He has been accused of plagiarizing his doctoral thesis. He has dismissed the accusation as a political attack from Basescu.
Romania's economy is starting to recover after two years of severe recession, but the International Monetary Fund recently said that "a prolonged political crisis could hamper effective economic policy making, increase risk premiums and financing costs, further depreciate the exchange rate, and depress investment."
The power struggle is expected to continue in the following months, as Romania is holding parliamentary elections this fall.
Journalist Cosmin Stan contributed to this report.