Riot police have rescued more than 100 people, including lawmakers and ministers, who were trapped for hours inside the Bulgarian parliament by an angry mob, on the 40th consecutive day of unrest to hit the eastern European country.

Several hundred anti-corruption protesters had gathered outside the palace in central Sofia, calling for the Socialist-led government to resign.

Inside, MPs were holding a late session to discuss controversial economic reforms.

Demonstrators put up barricades to cut off access to the building, blocking 109 ministers, MPs, journalists and members of staff inside the Parliament for more than eight hours.

Protesters shouted "Mafia!", "Resign!" and "Murderers!"

A first attempt by police to escort officials out failed as the bus carrying lawmakers was blocked by stone-hurling demonstrators. Seven protesters and two police officers were treated in hospital for head wounds.

"For the first time since the start of the protests we have now witnessed tension and attempts for provocation," President Rosen Plevneliev said, urging demonstrators to be "peaceful and civilised."

"We all live here, this is our country and we are responsible towards it. I urge for calm and order," he said.

In the early morning riot police successfully pushed their way into the crowd to form a corridor and allow the trapped politicians to come out.

Protests were sparked by the appointment of controversial media mogul Delyan Peevski as head of the national security agency earlier in June, and continued after the nomination was swiftly revoked.

Demonstrators claim Peevski's appointment was an example of oligarchal influence on a corrupt government that is failing to tackle poverty in one of Europe's most deprived countries.

The government led by Prime Minister Plamen Oresharski came to power in May after elections prompted by the resignation of the previous cabinet amid anti-austerity protests.

Bulgarian MEP Ivailo Kalfin, a former foreign minister, urged new ballots.

"With apologies to the millions, who voted two months ago, we need new elections," Kalfin wrote on Facebook.