Army officials said the militants attacked the base in al-Mallah town in southern Lahj province. The town is close to Abyan province, an al-Qaida stronghold.
The army fought back and by the time fighter jets were called in and forced the militants to retreat, 17 soldiers and 13 militants were dead. The officials spoke on condition of anonymity because they were not authorized to speak to the media. Al-Mallah is adjacent to Abyan province, an al-Qaida stronghold.
The latest clashes come as Washington appears to be increasingly involved in fighting al-Qaida in the Arabian Peninsula, as the Yemeni branch is known and which is believed to have plotted two failed attacks on American soil.
On Friday, unmanned US drones targeted al-Qaida positions inside Shabwa province, another militant hideout, killing four militants, Yemeni officials said. There was no immediate comment from US officials, but Washington has carried out deadly airstrikes in Yemen in the past, including the one that killed Anwar al-Awlaki last year.