Onlookers gather to watch soldiers on the roof of the Defense Ministry's compound during clashes in Sanaa, Yemen. (Khaled Abdullah/Reuters)

Clashes erupted in Yemen’s capital on Tuesday between the new government’s forces and soldiers loyal to the former regime, highlighting the divisions and volatility in the country six months after a populist uprising ousted President Ali Abdullah Saleh.

Hours after current President Abed Rabbo Mansour Hadi left the country to attend a conference in Saudi Arabia, elite Republican Guard soldiers under the command of Saleh’s son surrounded the Defense Ministry. Government troops quickly moved to protect the building, located in the capital’s center.

The sounds of gunfire and large blasts punctuated the bustling downtown for nearly an hour before the Republican Guard troops were pushed back. At least three people were killed, according to local news reports.

The assault came a week after Hadi sought to weaken the authority of Brig. Gen. Ahmed Ali Saleh, the former president’s son, by transferring some of his units to a new presidential protection force. The force would also include soldiers commanded by the elder Saleh’s key rival, Maj. Gen. Ali Mohsen al-Ahmar, who defected from Saleh’s government last year and used his troops to support protests that eventually ended the president’s 33-year rule.

“This is the usual maneuvering we have seen before over the implementation of the presidential decree with regards to military reorganization,” said Abdul Ghani Al-Iryani, a political analyst in Sanaa. “In the tradition of tribal Yemen, a shooting war is a form of negotiation.”

Restructuring Yemen’s military, which is deeply divided, is considered a crucial step toward helping Hadi maintain control and move the nation into a new era. Neighborhoods and checkpoints across the capital are still controlled by Saleh’s or Mohsen’s soldiers, or by tribesmen of the al-Ahmar clan, Yemen’s most influential tribal family, which is not related to ­Mohsen.

Tuesday’s strike was widely seen as an attempt to undermine Hadi’s authority and as a possible warning to him against following the path of post-revolution Egypt, whose new president, Mohamed Morsi, unexpectedly removed the top ranks of Egypt’s powerful military over the weekend.

The clashes in Sanaa underscore the influence that Saleh and his family still wield in this poor but strategic country, which is home to al-Qaeda in the Arabian Peninsula, the terrorist network’s most ambitious affiliate. The Obama administration has warned that it will impose sanctions on any member of Yemen’s government who interferes in the country’s political transition.

Yet many Yemenis think the former president, who lives in the capital, is trying to use his son and other loyalists in the military and government to maintain power, possibly setting the stage for future confrontations between Yemen’s old and new guard.

“If it were not for his meddling, his son would probably choose to follow the orders of the president,” Iryani said.

Yemen is increasingly a key front line in the fight against terrorism, with the United States deploying numerous drone strikes this year and aiding the country’s military to fight militants.