Bulgaria's Prime Minister Plamen Oresharski has apologised for a political appointment that plunged his three-week-old government into crisis.
His appointment of controversial media mogul Delyan Peevski as head of the national security agency provoked days of street protests, and prompted the main opposition to boycott parliament.
Parliament reversed the appointment on Wednesday.
There had been outrage that Mr Peevski was given access to top secret files.
The 32-year-old is understood to be behind a newspaper and TV empire, and was nominated by the ethnic Turkish junior party in the governing coalition.
Tens of thousands of people have taken to the streets of Sofia and other cities, for five days, to oppose his appointment.
Prime Minister Oresharski told parliament on Wednesday: "I made a political mistake, for which I apologise not only to you, but to the thousands of people who took to the streets to protest."
"They called for my resignation and I heard that clearly," he continued.
But he refused to step down, saying it would lead to a "bigger political crisis".
Bulgaria has already suffered a period of political paralysis.
Its centre-right Prime Minister Boiko Borisov resigned in February after big street protests about high electricity prices, austerity measures and mismanagement.
Elections were not held for three months, after which Mr Borisov emerged with a narrow lead.
However opposition parties refused to share power with him and eventually patched together their own coalition.