An official source from the ministry said security forces detained four al Qaeda militants during the early hours of the day. Fresh clashes then erupted, leading to the fighting in which the soldiers and militants were killed.
The remaining al Qaeda members fled to nearby mountains, leaving behind a car full of weapons, the source added.
Yemen has been in turmoil since mass protests forced long-term leader Ali Abdullah Saleh to step down in 2012. His successor, Abd-Rabbu Mansour, Hadi has been struggling to restore order.
Al Qaeda in the Arabian Peninsula (AQAP) is one of the most active branches of the network founded by Osama bin Laden and militants have plotted attacks against international airlines from there.
It is allied to a large group of local militants who have staged an insurgency in southern Yemen for three years, seizing areas of land, killing soldiers and bombing government and foreign targets. The authorities typically describe both groups as al Qaeda.
Maintaining stability in impoverished Yemen, which is also struggling with insurgents in southern and northern regions, is a priority for Washington and Gulf states because of its proximity to major shipping routes and Saudi Arabia, the world's top oil exporter.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ