"It happened after a day of clashes between government soldiers and the al-Qaeda cell they said was made up of 10 armed men," Mohamed Vall, Al Jazeera's correspondent in Sanaa, said.
"The government confirmed Mehdar was killed along with another fighter, and that three others escaped."
Al-Qaeda in Yemen claimed responsibility for the failed attack on a US airliner on December 25, and the US accused the group of training Umar Farouk Abdulmutallab, the alleged perpetrator of the planned attack.
In a separate incident in Shabwa on Wednesday, two Yemeni soldiers were killed in a road ambush, the country's state news agency reported.
Earlier, the interior ministry said at least 15 Shia Muslim fighters were killed in clashes with tribesmen loyal to the government and in operations by security forces launched on Houthi fighter strongholds in the north.
The Houthis first took up arms against the Yemeni government of Ali Abdullah Saleh, the president, in 2004, citing political, economic and religious marginalisation by the Saudi and Western-backed administration.
The conflict intensified in August when Yemen's army launched Operation Scorched Earth in an attempt to crush the fighters in the northern province of Saada.
Aid groups, which have limited access to the northern provinces, say at least 150,000 people have fled their homes since 2004 because of the fighting.