Romania's constitutional court on Monday approved last week's vote by lawmakers to suspend the country's president, and appointed a member of the centre-left ruling coalition to replace him.
"The court notes that the procedure for the suspension from his duties of Romanian President Traian Basescu has been respected ... and that the function of interim president will be assured by Crin Antonescu," it ruled.
Prime Minister Victor Ponta welcomed the ruling, which he said confirmed that "the government and the parliament respected the rules of democracy."
The court nevertheless ruled that a law passed by deputies limiting the court's power to intervene in parliamentary decisions was unconstitutional.
But it said that objections by the opposition Liberal Democratic Party (PDL) over the legality of last week's sacking of the speakers of both the Senate and the Chamber of Deputies were not admissible. Both positions were held by PDL members.
Most legal observers had anticipated this ruling for procedural reasons.
On Friday, 256 out of 432 deputies voted to impeach the centre-right Basescu over claims he improperly assumed the powers of the prime minister when he announced drastic austerity cuts in 2010.
The vote, and the court's ruling, mean Basescu will be suspended at least until the public can vote on the issue in a referendum set for July 29.
Friday's parliamentary vote followed a series of controversial moves by Romanian lawmakers, including the sacking of the ombudsman and the speakers of parliament.
The situation has provoked growing alarm from fellow EU members, the United States and rights groups.
The latest criticisms came from Germany earlier Monday, which condemned the impeachment proceedings as "unacceptable" and a violation of democratic principles.
"The suspension of Basescu on Friday and the initiation of a referendum took place in such a way that they violated the basic principles of the rule of law and, above all, respect for constitutional institutions," German government spokesman Steffen Seibert said in a statement.
Since the current centre-left coalition came to power in May, Ponta has been in open conflict with the centre-right Basescu.
They fought over who should represent the country at international summits, with Ponta challenging the fact that Basescu had been attending European summits.
The constitutional court found in Basescu's favour last month, but that did not stop Ponta from attending a meeting of the European Council in Brussels a few days later.
Then in July the ruling coalition voted out the two parliamentary speakers from their positions.
Last week, the constitutional court denounced what it said was were the government's "unprecedented, virulent" attacks on it.
It complained to the Council of Europe, the pan-European rights body, which echoed its position.
Last week, the United States led expressions of concern that Ponta's administration has been eroding democratic checks and balances in its campaign to oust the 60-year-old Basescu, who first took office in 2004.
The European Union as well as France, Germany, the Council of Europe and several rights groups, including Freedom House and the Helsinki Committee, also expressed concern at events in Romania.
Ponta has sought to allay Western fears over the health of its democracy.
He will visit Brussels later this week to give assurances to the bloc, which Romania joined in 2007 under Basescu.