The British ambassador to Yemen escaped assassination today after a suicide bombing of his security convoy on a narrow section of road on the way to the embassy in the country's capital, Sana'a.

Tim Torlot was unhurt in the attack, which left the bomber dead and three others injured – two security guards escorting the motorcade and a bystander. An investigation was launched into how the bomber – identified as Ali as-Selwi, 22 – was able to identify the route of the convoy and come so close to his assumed target.

The attack shattered a period of relative calm in Yemen four months after counter-terrorism forces launched a major offensive against al-Qaida in the Arabian Peninsular (AQAP), the group that claimed responsibility for the failed bombing of a US airliner over Detroit last Christmas.

Witnesses to the Sana'a attack reported seeing a man in a tracksuit and trainers waiting by the side of a road packed with market stalls for the convoy to pass. He was said to be carrying a rucksack.

A number of locals said the explosion went off before the convoy passed and that an armoured vehicle with diplomatic plates and with its windscreen shattered was seen driving away against the traffic.

Hamdi Amer, a 24-year-old student, told the Guardian he was woken by the blast which shook his house shortly before 8am local time. "I went down on to the street and saw the shin bone of the bomber. It was disgusting. It's a kind of terrorism. They must have brainwashed him." Police retrieved the head from the roof of a nearby house.

Yemen's interior ministry later announced that the bomber was from Taiz, a major city between Sana'a and the southern port of Aden, and that the attack bore the hallmarks of al-Qaida. Abdel Karim Aryani, a long-time adviser to President Ali Abdullah Saleh, said the bombing was "one of the most serious acts of terrorism to have happened in Yemen.

"To target an ambassador who was under the protection of the Yemeni government makes the damage to Yemen immeasurable. We didn't need this attack to tell us that al-Qaida has not left Yemen and that we must continue in our effort to track and confront them."

Last month Somali security sources told Reuters that a dozen AQAP members, including senior leaders, had crossed the Gulf of Aden from Yemen to Somalia.

Yet in private, few Yemeni officials believe that the AQAP leadership has left Yemen and it is believed that the threat level against western targets in Sana'a remains high. On 16 April the interior ministry announced it was beefing up security around foreign embassies.

Today's assassination attempt underscores the fact that though the AQAP leaders are believed to be hiding in Shabwa – a remote eastern province where Yemeni air strikes targeting militants have killed civilians – their network remains capable of launching operations in the heart of the capital.

"We can't delink security from development. The future of Yemen lies in economic reform but the security situation undermines that," saidembassy spokeswoman Chantel Mortimer. "Young Yemenis are the ones who are hurt most by attacks like today's."

Torlot caused a diplomatic stir last November which damaged his public profile in this deeply religious and conservative country after the British press published details of an extra marital affair with a US journalist working in Sana'a.