VALLETTA, Malta — Maltese Prime Minister Joseph Muscat told the nation Sunday night that he would resign in January following pressure from angry citizens for the truth about the 2017 car bombing that killed a journalist.

In a televised message, Muscat said he has informed Malta’s president that he will quit as leader of the governing Labor Party on Jan. 12 and that "in the days after I will resign as prime minister."

Hours earlier, thousands of Maltese protested outside a courthouse in the capital, Valletta, demanding that he step down.

“As prime minister, I promised two years ago that justice would be done in the case of the murder of Daphne Caruana Galizia,” Muscat said, beginning his speech, adding that “today I am here to tell you that I kept my word.”

He noted that in addition to three people arrested soon after the bombing for carrying out the actual attack, now there is “someone accused of being the principal person behind this killing.”

Muscat was referring to prominent Maltese businessman Yorgen Fenech, who on Saturday night, was arraigned on charges of alleged complicity in the murder and of allegedly organizing and financing the bombing. Fenech entered pleas of innocence.

Muscat’s former chief of staff Keith Schembri was allegedly linked to the killing. Schembri was among government members targeted by Caruana Galizia’s investigative reporting. Schembri, who resigned last week, was arrested in the probe but later released. He denies wrongdoing.

The prime minister insisted that he will see to it that “justice is for everyone,’’ and said the investigation is still ongoing.

Labor has a comfortable majority in Parliament, indicating that a new party leader could become premier without the need for a national election. Muscat, first elected as prime minister in 2013, is serving his second term.

Close to 20,000 Maltese citizens jammed Republic Street outside the courthouse in what was by far the largest turnout so far in weeks of public outpouring of anger and disgust aimed at Muscat's government.

The slain reporter had written extensively about suspected corruption in political and business circles on the European Union nation, which is a financial haven for many investors.

Among her targets were those in Muscat’s political inner circle, including those in his Cabinet. Caruana Galizia was the subject of lawsuits by some of her subjects, including in government. While many celebrated her as an anti-corruption champion, some on the island whose dealings she exposed scorned her work.

“I reiterate my deepest regret that a person, who, with all her positive and negative qualities and contribution toward the democracy of our country, was killed in such a brutal way,’’ Muscat said.

"The sensations of genuine sadness and anger for this murder are justified. And I will never accept that someone conveys a signal that in any way he or she is justifying this murder.”

European Parliament lawmakers are due to visit Malta in coming days, amid concerns about the functioning of rule of law on the Mediterranean island nation.

Muscat struck a defensive note.

“Our institutions are strong and they function. Shame on anyone who ridicules them as he or she is ridiculing our country.”