A rocket narrowly missed the US Embassy compound in Kabul, Afghanistan, on Wednesday during the first few minutes of the 18th anniversary of 9/11.

Loudspeakers inside the office broadcast a warning that “an explosion caused by a rocket has occurred on compound” in the minutes after the strike at midnight, The Associated Press reported.

No one was injured, the nearby NATO mission told the AP.

A US State Department official told Radio Free Europe/Radio Liberty: “We can confirm there was an explosion near the US Embassy in Kabul. US mission personnel were not directly impacted by this explosion.”

Nosrat Rahimi, a spokesman for the Afghan Ministry of the Interior, told Gulf News that the rocket hit the Ministry of Defense.

The news came amid heightened tensions between the US and the Taliban, the insurgent group that rules over large swathes of Afghanistan.

US and Taliban officials were due to meet at Camp David in Maryland on Sunday to discuss a peace process and a possible end to the US military presence in Afghanistan, but President Donald Trump abruptly canceled the talks the day before.

Donald Trump taliban

Foto: President Donald Trump.sourceErin Scott / REUTERS

About 14,000 US troops remain in the country, a situation that has angered Trump. Last month, the US and the Taliban reached a provisional agreement to remove several thousand troops.

However, on Monday, Trump said the talks were "dead." He cited the death of a US serviceman killed by a Taliban car bomb at a Kabul NATO checkpoint on Thursday in canceling the covert Sunday meeting.

A Taliban spokesman, Zabihullah Mujahid, told Al Jazeera that the US would suffer the consequences of axing the talks.

Kabul Embassy

Foto: The US Embassy in Kabul.sourceWikimedia Commons

"We had two ways to end the occupation in Afghanistan. One was jihad and fighting, the other was talks and negotiations," he said.

He added: "If Trump wants to stop talks, we will take the first way and they will soon regret it."

The US invaded Afghanistan in November 2001 with the aim of defeating Al Qaeda and hunting down Osama bin Laden, the mastermind of the 9/11 attacks whom the US accused the Taliban of hiding.

Read more: The GOP lawmakers disgusted by Trump's invitation to the Taliban are the latest sign his foreign policy is in shambles

As many as 100,000 US troops were in Afghanistan at the war's peak, and more than 2,400 have been killed.

US soldiers troops war in Afghanistan

Foto: US troops in Afghanistan.sourceREUTERS/Tim Wimborne

The US Embassy in Kabul did not immediately respond to Business Insider's request for comment.