The gunmen stormed Al-Mahfad base in Abyan province and remained inside for several hours before military reinforcements came, three security officials told AFP, adding that the soldiers were killed in clashes with the militants.
"The Qaeda gunmen took advantage of what happened (Thursday) in Aden and launched an assault on Al-Mahfad base and clashed with soldiers," a government security official said.
"Military reinforcements were sent and the gunmen were killed while others were driven out with air support from the (Saudi-led) coalition, in an operation that lasted hours," the official said.
"At least 19 soldiers were killed and others wounded."
The other two officials confirmed both the details and the death toll.
On Thursday, separate attacks by Shiite rebels and militants hit security forces in Yemen's second city Aden, killing at least 49 people, many of them newly trained police cadets, officials said.
The first attack was a suicide car bombing carried out by militants on a police station that killed 13 police officers and wounded several others, a security source said.
The second attack was carried out by the Huthi rebels, who said they launched a drone and a ballistic missile at a training camp west of Aden.
The aerial attack hit as senior commanders were overseeing a passing out parade for newly graduated cadets at Al-Jala Camp, 20 kilometres (13 miles) from the centre of Aden.
Aden is controlled by the Yemeni government and its supporters in a Saudi-led military coalition, which has been fighting the rebels since 2015.
The Huthis claimed responsibility for the drone and missile attack on Al-Jala training camp but there was no claim of responsibility for the suicide bombing on the police station.
The Yemen-based Al-Qaeda in the Arabian Peninsula (AQAP), the Islamic State group and other militants have flourished in the chaos of the civil war between the government and the Huthis.
The United States considers AQAP the global militants network's most dangerous branch and has waged a long-running drone war against its leaders.