All the nearly dozen diplomats were safe and were heading back to Islamabad, police said.
"All the ambassadors remained safe in the attack and had been shifted to a safe place before their departure to Islamabad," Deputy Inspector General of police Mohammad Ali Gandapur told Reuters.
The nationality of the diplomats was not immediately clear. A Pakistani foreign office spokesperson did not immediately respond to a request for a comment.
No one claimed responsibility for the attack.
Pakistani counter-terrorist forces maintain a strong presence in the Swat valley, which has long been a hotbed of Islamist militant insurgency. The militants have stepped up their attacks since late 2022 after breaking a ceasefire with the government.
In 2012, Islamist militants shot and wounded Nobel Peace Prize laureate Malala Yousafzai in the valley.