The UK government announced a multi-million-pound package Wednesday to boost the security of elected lawmakers who say they face increasing threats.

The £31 million ($39 million, 36 million euros) in extra funding over the next year comes as some British MPs have been targeted over their stance on the Israel-Hamas war.

It also comes with the country due to head to the polls in a general election expected later this year.

Under the new provisions, lawmakers will have access to a dedicated police contact to discuss security while those most at risk could seek bodyguards, the interior ministry said.

The money will also expand cybersecurity advice to MPs and increase police patrols in areas witnessing heightened community tensions, the Home Office added.

"None of us should have to accept that enduring hate crimes, harassment, or threats is part of the job," interior minister James Cleverly said in a statement.

British MPs have expressed growing concerns about their safety amid a surge in anti-Semitic and Islamophobic incidents since the conflict in Gaza broke out on October 7.

Prime Minister Rishi Sunak said MPs had been "verbally threatened and physically, violently targeted", with "legitimate protests hijacked by extremists".

Conservative MP Mike Freer, who represents a large Jewish area, revealed last month that he would not seek re-election because of a spate of threats and an arson attack on his office.

Earlier this month, fellow Tory Tobias Ellwood said 80 pro-Palestinian protesters had gathered outside his home, with police warning his family to "stay away" so as not to antagonise the crowd.

Last week, Commons speaker Lindsay Hoyle cited threats to lawmakers as a reason for his controversial handling of a debate about calls for a ceasefire between Israel and Hamas.

And on Monday Labour MP Dawn Butter told the chamber that she had been forced to seek extra police support after suffering "far-right abuse".

UK lawmakers have long been wary of their security following the high-profile murders of two MPs in recent years.

They are entitled to extra security at their homes and constituency offices under Operation Bridger, which was established in 2016 following the killing of Labour MP Jo Cox.

Cox was shot and stabbed by a neo-Nazi sympathiser before the Brexit referendum.

In 2021, Conservative MP David Amess died from multiple stab wounds inflicted by an Islamic State group follower.

In 2010, Labour MP Stephen Timms was stabbed and seriously wounded by an Islamist extremist as he met constituents in east London.