Bulgaria's president has appealed for calm after weeks-long protests escalated into a blockade of parliament and clashes with police.
President Rosen Plevneliev urged both protesters and police to remain "peaceful and civilised".
More than 100 politicians, journalists and staff were trapped inside the building overnight, until escorted out by police at about 05:00 (02:00 GMT).
PM Plamen Oresharski has so far resisted protesters' calls to resign.
The unrest fell on the 40th straight day of anti-government protests against corruption and mismanagement in the capital, Sofia.
Crowds surrounded the parliament building on Tuesday evening as MPs took part in an unusual late sitting to discuss a controversial budget update that would increase the budget deficit and government borrowing limit.
The protesters shouted "Mafia!" and "Resign!"
At around 22:00 local time, riot police attempted to move some of the MPs, including three government ministers, out of parliament on a heavily guarded bus.
But protesters prevented the bus from leaving. Skirmishes broke out in which at least seven protesters and two officers were injured.
The crowd reinforced their blockade with rubbish bins, street signs and paving stones.
Eventually, riot police reinforcements helped clear a path and the building was evacuated by 05:00 on Wednesday morning.
A reporter for the AFP news agency said the barricades were completely dismantled and the crowd dispersed.
Interior Minister Tsvetlin Yovchev said: "There are lightly injured people and policemen and there have been arrests... No lawmakers have been hurt."
President Rosen Plevneliev said: "For the first time since the start of the protests we have now witnessed tension and attempts for provocation.
"We all live here, this is our country and we are responsible towards it. I urge for calm and order," he said.
Parliamentary speaker Mihail Mikov condemned the violence, calling for a cancellation of Wednesday's parliamentary session.
"Order must be guaranteed. Lawmakers cannot be turned into targets; their life and health cannot be put in danger," he told state BNT TV.
Bulgaria - the poorest EU member state - has been in political turmoil for months.
The current coalition government took office after a snap election in May, which followed extended protests.
Renewed protests began nearly six weeks ago, over the controversial appointment of a young media mogul, Delyan Peevski, as head of the national security agency.
Protesters saw it as example of the influence of powerful "oligarchs" and the corruption of politicians.
The appointment has been reversed, but the crowds have not been appeased and other controversial decisions have fuelled their anger.
Prime Minister Plamen Oresharski, who heads the Socialist-led coalition, has refused to resign, saying it would only deepen the crisis.
Earlier on Tuesday, the EU's visiting Justice Commissioner Viviane Reding said she backed the protesters.
Ms Reding, who was in the country for a live question and answer session, said on Twitter: "Here in Sofia today, my sympathy is with the Bulgarian citizens who are protesting against corruption."
"We can't replace your government, but we have a responsibility to see that things are going well," Ms Reding told the forum.