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

Loudspeakers throughout the building broadcast the message "an explosion caused by a rocket has occurred on compound," The Associated Press reported.

The rocket hit Afghanistan's defense ministry, but no one was injured, an official told Gulf News.

Over the weekend, President Donald Trump scrapped negotiations between the US and the Taliban aiming to secure an end to the war in Afghanistan.

A US service member was killed by a Taliban car bomb on Thursday, which Trump cited as the catalyst for the abrupt end to the talks.

Visit Business Insider's homepage for more stories.

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," 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 a wall at the defense ministry and that no one was hurt.

—Aditya Raj Kaul (@AdityaRajKaul) September 10, 2019

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 an end to the US military presence in Afghanistan, but President Donald Trump abruptly canceled the talks the day before.

President Donald Trump. Erin 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 service member 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.

The US Embassy in Kabul. Wikimedia 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 troops in Afghanistan. REUTERS/Tim Wimborne

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