A gun battle of up to an hour erupted on Friday when militants attacked the main gate of the palace in the capital Sanaa, the security source said.
After the gunfight, Sanaa was in lockdown and security checkpoints were erected at all the main entrances into the capital.
There was no immediate reaction from any senior Yemeni officials on the attack.
In the south, Defense Minister Muhammad Nasir Ahmad escaped an assassination bid by suspected al Qaeda gunmen who attacked his motorcade in the province of Shabwa.
The defense ministry's website later claimed the shots heard near Ahmad's convoy were celebratory gunfire.
Yemeni security forces also arrested two French men believed to be members of an al-Qaeda cell in Yemen, an official security source said on Friday. Paris confirmed that two of its citizens had been detained.
Since late April the government has stepped up its campaign against the Yemeni group considered al-Qaeda's most active unit, al-Qaeda in the Arabian Peninsula (AQAP), driving it from some of its strongholds in the south.
RA/MB