(Adds detail, quotes)
SANAA, May 9 (Reuters) - Four Yemeni soldiers were killed in a gunfight with militants at the presidential palace in the Yemeni capital Sanaa on Friday, a security source told Reuters, in a major escalation in the country's fight against an Islamist insurgency.
After a series of drone strikes and an army offensive in the south of the country for the past 10 days, most al Qaeda militants have fled their southern strongholds.
Friday's fighting seemed to be a retaliatory measure for the army campaign against the militants. Earlier in the day, the defence minister survived an assassination attempt by suspected al Qaeda militants while he was travelling in the southern province of Shabwa.
In Sanaa, heavy gunfire was heard in the area surrounding the palace for up to an hour, residents said.
A security source told Reuters that a vehicle carrying a number of armed militants thought to be linked to al Qaeda had attacked the main gate of the palace and gunfire broke out.
"Four soldiers at the palace were killed by the militants," said the security source.
"There was a gunfight that lasted about 45 minutes and then a few of the militants managed to escape with their car," the source said, adding that there were casualties on both sides.
The source said security forces in the area were looking for the militants in a nearby public garden.
An explosion was also heard near a building used by the government's security service in another district of the city, residents told Reuters. There was no immediate word on the cause of the blast.
Police forces in the city have tightened security and residents in the affected areas were advised not to leave their homes.
Western powers are concerned that al Qaeda in the Arabian Peninsula could use Yemen, which neighbours top oil power Saudi Arabia, as a springboard for future attacks. (Reporting by Mohamed Ghobari; Writing by Amena Bakr and Yara Bayoumy; Editing by Hugh Lawson)