TIRANA (Reuters) - A three-month standoff that had blocked progress on reforms to Albania’s government ended on Thursday, as the ruling parties and the opposition reached agreement on how to resolve their conflict.

FILE PHOTO: Democratic Party leader Lulzim Basha speaks to his supporters during a protest against the government in front of Prime Minister Edi Rama's office, in Tirana, Albania, May 13, 2017. REUTERS/Florion Goga

The agreement could also revive Albania’s stalled effort to joining the European Union. It creates bodies to vet judges and prosecutors, in a first step toward an independent judiciary, a key condition for accession talks with the EU.

“We have reached an agreement ...,” opposition Democratic Party leader Lulzim Basha said, flanked by Prime Minister Edi Rama.

Rama and Basha agreed to let the opposition control seven ministries by appointing technocrats, including the interior ministry.

A general election will be postponed by one week, to June 25. The opposition will pick the head of an election commission.

The opposition agreed to return to parliament after boycotting it for three months, in order to pass a bill that would set up the agency to vet judges and weed out corrupt magistrates.

The deal came exactly three months after Basha led the Democrats in a rally asking for a technocratic government. Opposition lawmakers pitched a tent in the main boulevard of the capital, Tirana, turning it into their own parliament of daily anti-government speeches.

The EU and the United States, who have been pushing Albania to reform the judiciary, hailed Albanians for their patience and the two leaders for forging what appeared a durable agreement.

After three months of watching Basha and Rama threaten, taunt and bait each other with fiery speeches of revolution and “a new republic sweeping away the old”, Albanians felt relieved they talked for three hours and shook hands later.

“We urge the two main leaders to end at the same time with this detailed agreement the institutional crises created and solved in the restricted circle of the political leaders,” said the Coalition of Domestic Election Observers.

The ruling Socialists and the Democrats also agreed to start begin constitutional and electoral reforms when parliament reconvened.

A court on Thursday delayed judgment on whether the ruling Socialists and other parties had failed to respect the deadline to register for the election. The opposition parties had failed to register, vowing to boycott the polls.