The attack in the province of Marib targeted a car carrying the suspected militants.
A military official says five were Yemenis and the sixth was believed to be of an Arab nationality.
Yemen is on a state of high alert after authorities revealed an al-Qaida plot to target foreign embassies and international shipping lanes in the Red Sea. The US and British embassies have evacuated staff.
Six US drone strikes over the past 10 days have killed a total of 29 suspected militants.
Earlier Yemen said it had foiled plots by al-Qaida to take over key cities and attack strategic ports and gas facilities amid heightened anti-terror tension in the country.
Al-Qaida planned to target the cities of Mukalla and Bawzeer, then send militants disguised as Yemeni troops to attack two strategic oil ports in the impoverished country on the Arabian Peninsula, a government spokesman said.
Other militants would also try to sabotage pipelines to “create panic among Yemeni army and Yemeni security services,” he said, adding that authorities managed to foil the plots in the past 48 hours.
Yemen has emerged as the focus of a possible attack that has led the US to shut down temporarily 19 diplomatic posts in the Middle East and Africa.
Washington has been backing a campaign by Yemen’s military to uproot al-Qaida militants and their radical allies who had taken over a string of southern cities and towns. The militants have largely been driven into the mountains and countryside, and Yemeni intelligence officials say the current threat may be retaliation for that offensive.
Security checkpoints have been set up across Sana’a and the army has surrounded foreign installations, government offices and the airport with tanks and troops. It is also guarding the strategic straits at the mouth of the Red Sea.