Media playback is unsupported on your device Media caption Officials at the mothballed state broadcaster described the court ruling as a "victory" over the Greek government

A Greek court has ordered that state broadcaster ERT, which was shut down by the government last week, can resume transmissions.

However, the court also upheld a plan by Prime Minister Antonis Samaras to replace ERT with a smaller broadcaster.

The ruling came as Mr Samaras and his coalition partners - furious that they had not been consulted about ERT's closure - held crisis talks.

The prime minister's decision triggered mass protests across the country.

Analysis Greece's government has emerged from this battle intact but badly bruised. The prime minister's plan to replace ERT with a smaller, cheaper broadcaster can now go ahead. But his move to pull the signal in the interim has been reversed by Greece's supreme administrative court, a victory for the other coalition leaders who were furious at the sudden closure. There were jubilant scenes among staff at ERT headquarters that programming can continue, although many will lose their jobs as a leaner structure is formed. Greece's government seems to have survived its worst political crisis in its year in office - but the coalition leaders will meet again to discuss the cracks that have widened over this issue and to present a show of unity.

The leading party in the governing coalition, the conservative New Democracy, said last Tuesday that ERT suffered from chronic mismanagement, lack of transparency and waste.

It shut the broadcaster down with the loss of nearly 2,700 jobs. Viewers saw TV screens go black as the signal was switched off.

Greece's top administrative court - the Council of State - upheld Mr Samaras's plan to replace ERT with a new broadcaster later this year but backed the position of the other coalition partners that the signal must be restored in the interim.

Some ERT journalists have continued live broadcasts unauthorised over the internet, and when the ruling came through, a strapline across the screen said: "In a few hours ERT will be broadcasting everywhere."

'Seven nights'

The case was brought by ERT's union in an attempt to overturn Mr Samaras's surprise move.

The BBC's Mark Lowen in Athens says each side will claim victory, but in the end the unity of the government has been badly weakened.

During talks, Mr Samaras had suggested a new, leaner, cheaper broadcaster would be established within weeks and he proposed hiring a small team to produce news programmes in the interim.

But this idea was rejected by his two coalition partners - Evangelos Venizelos of Pasok and Fotis Kouvelis of the Democratic Left.

"The court decision is essentially in line with what we've said: no one has the right to shut down national radio and television and turn screens black," said Mr Kouvelis after the emergency talks ended.

Image caption Opposition party Syriza staged a protest in Syntagma Square on Monday evening

Mr Venizelos said they would meet again on Wednesday to discuss a cabinet reshuffle.

An official from New Democracy said the ruling affirmed the government's position that ERT had been scrapped.

The row has threatened to topple the government and force Greece into snap elections, triggering political turmoil with implications for the whole eurozone.

ERT workers celebrated outside the broadcaster's headquarters after hearing the court ruling.

"I've been here seven nights and this is the first time I've seen people smile," said reporter Eleni Hrona.

However, our correspondent says there is also the recognition that later this year many will lose their jobs as a smaller broadcaster is formed.

Meanwhile, as coalition leaders went into talks, the main opposition party Syriza held a rally in Athens' Syntagma Square to demand early elections.