Maltese Prime Minister Joseph Muscat has announced on national TV that he will step down in the new year, amid a crisis over a murdered journalist.
He said he would ask the ruling Labour Party to begin the process to choose his successor on 12 January.
Demonstrators have demanded his immediate resignation over the inquiry into Daphne Caruana Galizia's death.
She was killed by a car bomb in 2017 as she investigated corruption among Malta's business and political elite.
A businessman with alleged links to government officials was charged with complicity in the murder on Saturday.
Explaining his decision to quit, Mr Muscat said of the way the murder inquiry had been handled: "Some decisions were good while others could have been better made."
"All the responsibility I had to shoulder surely does not compare to the pain that the victim's family is enduring," he added.
When will Muscat step down exactly?
He said he would resign as leader of the Labour Party on 12 January and as prime minister "in the days after".
Mr Muscat has been in power for six years, winning two elections by a landslide and presiding over a period of prosperity and social reform in the EU's smallest member state.
"Malta needs to start a new chapter and only I can give that signal," Mr Muscat said.
He took the decision after a four-hour meeting with Labour's parliamentary group, at which MPs gave "unanimous support to all decisions which the Prime Minister will be taking".
Why do protesters want Muscat to go now?
A large crowd of protesters earlier rallied in the capital Valletta to demand Mr Muscat's immediate resignation.
Copies of a photo showing Mr Muscat's former chief of staff, Keith Schembri, alongside Melvin Theuma, an alleged middleman in Caruana Galizia's murder, were pinned to the gates of the building.
Fury over Mr Muscat's handling of the crisis grew this weekend when businessman Yorgen Fenech was charged with complicity in the murder, an allegation he denies.
Mr Fenech was identified last year as being the owner of a mysterious Dubai-registered company, 17 Black, listed in the Panama Papers - a massive leak of documents from an offshore law firm in 2016.
There were allegations that 17 Black planned to make secret payments to companies set up by Mr Schembri and Tourism Minister Konrad Mizzi.
Both men resigned this week but deny any wrongdoing, and Mr Mizzi has denied any business links to Mr Fenech.
Three other men are in custody charged with Caruana Galizia's actual murder, which involved a car bomb.
The murdered journalist's family said the prime minister had been left deeply compromised and should resign because he had failed, for the past two years, to take action to clean up politics in Malta.
They argued that as long as he remained in place, a full investigation into Caruana Galizia's death was not possible.
In another development, Mr Muscat's Economy Minister, Chris Cardona, was reinstated on Sunday after suspending himself on Tuesday after he was questioned by police. He denies any wrongdoing.
What do we know about the murder inquiry?
Three men - brothers Alfred and George Degiorgio and their friend Vincent Muscat, all in their 50s - have been charged with triggering the bomb which killed Caruana Galizia near her home in October 2017.
They were arrested in December 2017 and pleaded not guilty in pre-trial proceedings.
Vincent Muscat later told police the bomb had been placed in Caruana Galizia's car while it was parked outside the walled compound where she lived. The killings earned the trio 150,000 euros (£132,000), Reuters news agency reports.