"Masked gunmen in a car without licence plates opened fire randomly on the soldiers while they were stationed near a military outpost in Maifaa region in Shabwa province," the official told Xinhua.
"We have spotted the armed men who are believed to have carried out the attack. Our troops are advancing toward them. The attackers escaped into the desert region," the official added.
So far, no one has claimed responsibility for the attack and there has been no official confirmation from the country's defence ministry.
Yemeni military officials blamed militantsof the Yemen-based Al Qaeda offshoot for a series of assassinations and armed attacks, mostly in the country's southern parts.
Al Qaeda in the Arabian Peninsula, also known locally as Ansar al-Sharia, which emerged in January 2009, is considered one of the greatest threats to the Yemeni government and neighbouring oil-rich Saudi Arabia.