A suicide bomber blew himself up inside a roadside mosque when a police officer tried to arrest him after a chase in northwestern Pakistan near the Afghan border on Tuesday, killing the officer, police said.

It was unclear whether any worshippers were at the mosque when the bombing took place in Khyber, a district in Khyber Pakhtunkhwa province bordering Afghanistan, police official Saleem Khan said.

The mosque collapsed because of the impact of the explosion, Khan said.

CHINA OUSTS FOREIGN MINISTER WHO HAS BEEN MISSING FOR A MONTH

Fox News Asia graphic

A suicide bomber killed a police officer inside a mosque near Pakistan-Afghanistan border on Tuesday.  (Fox News)

CLICK HERE TO GET THE FOX NEWS APP

He said no worshippers were inside the mosque when the suspect went there to hide.

Pakistan has witnessed an uptick in militant violence since last year when the Pakistani Taliban, who are known as Tehreek-e-Taliban Pakistan, ended a months-long cease-fire with the government.

The Pakistani Taliban are a separate group but an ally of the Afghan Taliban. They have become emboldened since the Taliban seized power in Afghanistan in August 2021 as U.S. and NATO troops were in the final stages of their pullout from the country after 20 years of war.