* Basescu can return to power after court voids referendum
* Government accepts decision, signals feud with president continues
* Dispute has raised EU concern for rule of law in Romania
By Ioana Patran
BUCHAREST, Aug 21 (Reuters) - Romania's Constitutional Court on Tuesday struck down a referendum to impeach President Traian Basescu, foiling a drive by the leftist government to oust its chief political opponent months before a parliamentary election.
The government said it would accept the decision, but the acting president said Basescu was now an "illegitimate" leader.
Several hundred people gathered in two main Bucharest squares in the afternoon, one crowd supporting the president and the other protesting against him. Both remained peaceful.
Two decades after the fall of communist dictator Nicolae Ceausescu, the battle pitting Basescu against Prime Minister Victor Ponta has raised rule-of-law issues and could flare again in coming months as one of the European Union's poorest states faces tough austerity demands from international lenders.
The court, as expected, ruled that the July 29 referendum called by the government to remove Basescu, a right-wing political veteran, was invalid because turnout fell short of the required 50 percent of the 18.3 million electorate.
"We stated that the referendum quorum condition was not met," Chief Judge Augustin Zegrean told reporters. He said Basescu, suspended by parliament before the referendum which was needed to confirm the impeachment, could now return to power.
The crisis has crippled policymaking, pushed the leu to record lows last month and angered the EU, which accused Ponta of undermining democracy and intimidating judges in a country long criticised for graft and a weak judicial system.
It shed light on weaknesses in Romania's institutions, a wider problem in ex-communist EU member states as shown in Hungary earlier this year where Prime Minister Viktor Orban clashed with the EU over constitutional changes.
Basescu is expected to return to office within days, pending rubber-stamping of the court decision by parliament on Friday. H is term expires in 2014.
The European Commission said in a statement that the legal procedure to reinstate Basescu should be respected and that it would monitor the situation very closely.
"I want to send a signal of stability to Romanians: The court decision will be respected and implemented," Ponta told a news conference.
In the referendum, 88 percent of those who voted supported Basescu's impeachment but turnout was only 46 percent. Basescu had called for a boycott. The court inspected revised voter lists after the government said they would show that the turnout had in fact reached 50 percent after the removal of voters who had died or moved abroad.
Acting President Crin Antonescu, a co-leader of the USL, made clear there would be no peace between Ponta, who became Europe's youngest prime minister in May at 39, and Basescu, 60, a former oil tanker captain who has been president since 2004.
"We do respect the court decision and Traian Basescu will again become a president. But he returns as an illegitimate president," Antonescu said. "The court refused to see that at least 2 million Romanians shouldn't have been taken into account for the referendum quorum."
There was no comment from Basescu, who as president has the power to appoint prime ministers and heads of security services, and to veto legislation temporarily.
Tension is likely to persist until parliamentary elections in November, which Ponta's USL coalition is expected to win, but the Balkan state also needs to focus on austerity policies to keep a 5 billion euro IMF stand-by agreement on track.
"Continuing political tension and forthcoming elections are not conducive to coherent policymaking, especially regarding adherence to the tight targets of the EU/IMF bailout agreement," said Otilia Simkova, an analyst at Eurasia group.
The leu strengthened by 0.4 percent after the court decision and Antonescu's statements to 4.4722 to the euro.
Ponta has accused Basescu of blocking government policies and turning a blind eye to corruption while starting a witch-hunt against rival politicians.
But Ponta has also been bruised by findings by an academic panel that his doctoral thesis in law was based on plagiarism.
Analysts said the battle reflected a broader struggle for power and control of the judicial system in a country where corruption is rampant and 19 members of parliament from Ponta's coalition are under investigation.
Officials of Ponta's party have denounced Basescu, saying he orchestrated the June conviction of Ponta's mentor, former prime minister Adrian Nastase, on charges of improper party funding.