Romania's prime minister, Victor Ponta, has said the political crisis that has gripped the country since May, pitting him against the president, is close to a resolution, bringing to an end what he called 20 years of "lost time" since the revolution brought down the communist dictatorship.

In an interview with the Guardian during a visit to London, Ponta said that if his coalition's bid to oust President Traian Basescu through a disputed referendum fail failed, he would be prepared to "cohabitate" as long as the president stuck to his constitutional role.

"This is maybe the biggest crisis in the last 10 years, but all the institutions, including the constitutional court, the parliament and government have proven solid, and I think the worst part has passed," Ponta said. "After this hot summer, we will go to a normal situation and we will prove all our European commitments will be fulfilled."

Ponta was speaking as a deeply divided constitutional court debates whether to uphold a 29 July referendum on Basescu's impeachment. More than 80% voted for his removal but the vote was boycotted by Basescu's supporters and the turnout fell below the quorum of 50%. Ponta's coalition has attempted to amend the electoral rolls on which the quorum is calculated, arguing they are out of date.

Ponta, Europe's youngest prime minister at 39 years old, adopted emergency decrees to limit the court's powers and remove the quorum requirement from the referendum, replacing the speakers of both houses of parliament and the national ombudsman. He was consequently rebuked by the European Commission and by his opponents for attempting a "coup".

Ponta rejected the allegation. "It's very clear the new coalition and the new government has huge popular support," the prime minister said. "For eight years, President Basescu used his powers to politically appoint everyone, even the judges in the constitutional court and the ombudsman. All the positions appointed by Basescus. Right now, we are going back to a balance between all the political forces."

He complained of "double standards" in his treatment by Brussels, arguing that Basescu had never been censured for his own very frequent use of emergency decrees.

"While I took office on 7 May, I was absolutely convinced in good will that we could cohabitate with President Basescu, because he is going to finish his mandate and he cannot run for another term. I'm young enough not to be a rival to Mr Basescu."

However, Ponta said Basescu, the former captain of an oil tanker, "could not accept he did not have majority in parliament and he constantly tried to delay the decisions of the government, attack the government. We got to this crisis because it was almost impossible to have a normal cohabitation."

Ponta pledged that if the constitutional court decided in Basescu's favour, he would be prepared to try cohabitation once more, but he made that once more dependent on the president's own conduct.

"He will go back to his office, and if Mr Basescu only follows his constitutional powers, everything will be fine and perfect," Mr Ponta said. "But Mr Basescu is a very strong personality. He was a former sea captain and in his DNA he has no ability to cooperate with anyone ... He should just exercise his constitutional powers, which are not very wide."

Basescu was suspended from office last month and is operating out of his campaign headquarters in Bucharest. He said he would not comment on the crisis until the constitutional court has ruled. Monica Macovei, a former justice minister and close supporter of Basescu, said the suspended president was ready for a reconciliation with Ponta.

But Macovei added: "I don't think Ponta is the problem." She said Ponta was under pressure from his coalition partner and acting president, Crin Antonescu, to prevent Basescu returning to office. She argued the real goal of Basescu's opponents was to dismantle the office of the anti-corruption prosecutors.

Laura Stefan, an anti-corruption expert at the Expert Forum thinktank in Bucharest, agreed.

"This unrest is generated by a transformation, the modernisation of Romania and introduction of rule of law. Powerful people never went to jail, but that is ending. So, of course, they are going to put up a fight. It's the worst fight since the revolution."

Alina Mungiu-Pippidi, a Romanian political scientist at the Hertie School of Governance in Berlin, said: "It is true that Basescu did a lot of things that the media and Brussels ignored. He said he wouldn't appoint Ponta and his coalition no matter what the outcome of elections. He believed the constitution was vague enough he could bend it."

However, she added: "This new coalition has done things that even Basescu did not, suspending the ombudsman and trying to change the electoral lists after the referendum."

Ponta argued that his actions are justified by the popular support behind him and were necessary to break a system of centralised powerful inherited from the dictatorship of Nicolae Ceausescu, who was overthrown in a popular revolution and executed on Christmas Day 1989.

"This is negative for a young Romanian because it means we have lost this 20 years because many people feel the regimes are very much the same. We have televisions, we have internet, but power is the same because Mr Basescu ... kept everything under his grip, the parliament, government, the intelligence services, so that is why people are so enthusiastic about getting rid of him. But to be very honest, we have lost a lot of time and energy in the last 20 years and that is why I hope something has radically changed in this hot summer."