The bombing near the presidential palace is one of the deadliest attacks in the city in months. The military says the attacker was a soldier taking part in the drill, lining up with fellow troops.
No one immediately claimed responsibility for the suicide bombing, but the soldiers targeted were mostly troops from Yemen's Central Security, a paramilitary force commanded by Yahya Saleh, a nephew of ousted president, Ali Abdullah Saleh.
In a separate incident, an al Qaeda group attacked three U.S. coast guard trainers in the Red Sea port city of Hodeida. One was injured, officials said. The three Americans were traveling in a car when the militants pulled up in another vehicle and shot at them.
The Associated Press contributed to this report.