LONDON — British politicians gathered Tuesday for a Mass to mourn the death of slain lawmaker David Amess, with Pope Francis sending a message calling for mourners to “combat evil with good.”

Prime Minister Boris Johnson, three former prime ministers and Keir Starmer, leader of the opposition Labour Party, joined others at Westminster Cathedral in London for the Requiem Mass for Amess, who was stabbed to death on Oct. 15 while holding a regular meeting with his constituents.

The attack, which took place in a church hall in Amess’ constituency in Leigh-on-Sea, shook Britain and raised questions about whether lawmakers need more security while carrying out their jobs. A 25-year-old man, Ali Harbi Ali, has been charged with murder and preparing acts of terrorism. He is due to enter pleas in December.

Archbishop Claudio Gugerotti read a message from the pope, who praised Amess for his “years of devoted public service guided by his strong Catholic faith.”

That is “evidenced in his deep concern for the poor and the disadvantaged, his commitment to the defense of God’s gift of life, and his efforts to foster understanding and cooperation with the Holy See in its universal mission,” Francis wrote.

The pontiff prayed that “all who honor his memory will be confirmed in the resolve to reject the ways of violence, to combat evil with good, and to help build a society of ever greater justice, fraternity and solidarity.”

Former Prime Ministers Theresa May, David Cameron and John Major sat side by side at the Mass, which followed a private funeral in Southend, in southeast England, on Monday.

Amess, 69, had served in Parliament for almost 40 years and was knighted by Queen Elizabeth II in 2015. He was a social conservative who opposed abortion, campaigned for animal rights and strongly supported Britain’s exit from the European Union.