A civilian was also killed in the gunfight which erupted at dawn after gunmen attacked the presidential guard checkpoint near Misbahi roundabout, around 500 metres from the palace, a statement said.
Authorities use the term "terrorists" to refer to Al-Qaeda militants in the impoverished Arab country, where an army offensive against jihadist strongholds has been underway since April 29.
Sanaa has been on alert for days, and tensions rose after the army said troops had entered Azzan, a jihadist bastion in southern Shabwa province, prompting the United States to close its Sanaa embassy on Thursday.
That attack came hours after the defence minister, who has vowed to crush jihadists active in Yemen, survived an ambush by suspected Al-Qaeda militants in the south of the country.
More From This Section
Yemen's army says its offensive against Al-Qaeda in the Arabian Peninsula strongholds in the contiguous provinces of Shabwa, Abyan and Baida has inflicted heavy losses on the jihadists.
AQAP is considered by Washington as the most dangerous affiliate of Al-Qaeda and has been linked to failed terror plots in the United States.
The army recaptured several major towns in 2012 but has struggled to reassert control in rural areas, despite the backing of tribal militiamen.