The bombing appeared to be a failed assassination attempt against the Minister of Defense, Maj. Gen. Mohammed Nasser Ahmed, who arrived at the heavily secured city square to greet the assembled troops just minutes before the blast ripped through the area.
Nobody claimed responsibility for the attack, but it came as the country's new political leadership has been stepping up the fight against al-Qaida militants holding large swaths of land in the nation's south.
Yemen's new president, Abed Rabbo Mansour Hadi, also has been embroiled in a power struggle with loyalists of ousted leader Ali Abdullah Saleh. He has sacked several of them along with family members from top positions in the armed forces, including the air force.
A statement in Hadi's name read on state TV said, "The war on terrorism will continue until we win, whatever the sacrifices are."
"We are speeding up the restructuring of the army to bring back stability to the country which was on a brink of all out war," he said. "Yemen can't bear more crises."
The suicide bombing raised fears that al-Qaida in Yemen, which has been blamed in a string of attempted attacks on U.S. targets, is striking back against the U.S.-backed offensive targeting the group's stronghold.
The Pentagon also confirmed that three civilian contractors helping train Yemen's coast guard were attacked Sunday in Yemen. Cmdr. Bill Speaks, a Defense Department spokesman, said Monday that injuries to the party were minor.
The three were traveling in a car in the Red Sea port city of Hodeida on Sunday, when they were shot at by militants in another vehicle.
Yemeni officials initially said the three were members of the U.S. Coast Guard, but the Guard denied that.
Military officials said the suicide bomber in Sanaa was a soldier taking part in the drill, lining up with fellow troops at a main square in the capital, not far from the presidential palace. He belonged to the Central Security, a paramilitary force commanded by Saleh's nephew Yahia, the officials said, speaking on condition of anonymity because they were not authorized to speak to the media.
Witnesses described the same scenario, but officials said they were still investigating.
Monday's bombing left a scene of carnage, with scores of bleeding soldiers lying on the ground as ambulances rushed to the scene. Several severed heads were on the pavement amid large pools of blood and human remains.
"This is a real massacre," said Ahmed Sobhi, one of the soldiers who witnessed the explosion. "There are piles of torn body parts, limbs, and heads. This is unbelievable. I am still shaking. The place turned into hell. I thought this only happens in movies."
The bomber detonated his explosives minutes before the arrival of the defense minister and the chief of staff, who were expected to greet the troops, the officials said. The drill was a rehearsal for a parade for the celebration of Yemen's National Day on Tuesday.
Soldiers hand-picked by their commanders from different branches of the military have been practicing together for the parade for a week, Sobhi said, citing that as evidence that the attacker was a soldier and not an infiltrator.
The site of the attack has been sealed off by Republican Guard forces for the past 24 hours in preparation for the National Day celebrations. No cars or pedestrians were allowed to enter. The Republican Guard is led by Saleh's son and one-time heir apparent, Ahmed.
Khaled Ali, another soldier, told The Associated Press over the phone from the site of the attack that the explosion was followed by heavy gunfire.
"In the mayhem, we were all running in all directions. I saw the guards of the minister surrounding him and forming a human cordon. They were firing in the air," he said.
Shortly after the attack, Hadi demoted two of Saleh's relatives from their top positions in the Central Security forces and the interior ministry. A new commander Fadl al-Qousi was appointed as the top commander of Central Security forces, at the top of Saleh's nephew, Yahia. Another Saleh's in-law Mohammed al-Qousi lost his post as the commander of a police force.
Saleh stepped down in February as part of a U.S.-backed, power-transfer deal brokered by Gulf Arab countries. It gave Saleh immunity from prosecution in return for relinquishing his power.
Since then Hadi has pledged to restructure the army and purge it from Saleh's family members and loyalists suspected of hindering reforms.
Hadi has also vowed to step up the fight against al-Qaida, which expanded its foothold after exploiting the political and security turmoil in the wake of the uprising against Saleh.
Since the revolt erupted, inspired by other Arab Spring uprisings, al-Qaida militants overran large swaths of territory and several towns and cities in the south, pushing out government forces and establishing their own rule.
In recent weeks, the army has launched a concerted effort to uproot the militants from their strongholds -- and is closely coordinating with a small contingent of U.S. troops who are helping guide the operations from inside Yemen.
Monday's bombing is one of the deadliest attacks in Sanaa, the capital.
In June, an attack targeting Saleh's compound last year left 11 bodyguards dead and seriously injured Saleh and five senior officials worshipping just alongside him. In 2008, an attack on U.S. embassy in Sanaa left some 19 Yemeni soldiers dead.
Yemen, the ancestral homeland of Osama bin Laden, was the site of the 2000 bombing of the USS Cole, which killed 17 American sailors. There have also been a spate of assaults on the U.S. Embassy in Sanaa, including a 2008 bombing that killed 10 Yemeni guards and four civilians.