Afghanistan's Taliban movement claimed responsibility for the attack.
Karzai sped off in a motorcade in the immediate wake of the attack, which continued for a further 15 minutes.
He appeared on television for a live address shortly after the incident, assuring the public that the incident was over and that some of the attackers had been caught.
Karzai is a Pashtun leader favoured by the US military administration in Kabul and Washington
Worked as a consultant to Unocal, an oil company with significant oil interests in the region
He was handpicked to lead the country in December 2001, after a US-led invasion against the Taliban
He was confirmed as Afghanistan’s president in June 2002 by the country’s Loya Jirga (grand council)
Karzai's influence in Afghanistan is at its highest in the capital Kabul
Several attempts have been made to assassinate him, in attacks mostly blamed on Taliban fighters
"Fortunately Afghan security forces quickly surrounded them ... Some of them were captured," Karzai said.
"Everything is calm, rest assured," he said.
A defence ministry spokesman said that all cabinet members and foreign diplomats were also safe.
"President Hamid Karzai, with all the cabinet members and foreign diplomats who were on the main stage, are safe," General Mohammad Zahir Azimi said.
"They have been evacuated from the area. It is not an exact report yet, and I'm not sure, but I heard two parliamentarians are wounded."
Al Jazeera's Zeina Khodr said that the Taliban had warned that they would carry out some sort of operation to disrupt the ceremony.
"To them, this ceremony should not be taking place because they are against the government and the foreign forces," she said.
|Six people, including three Taliban fighters, |
were killed in the attack [AFP]
"They said the target was to give them a message that they are not safe. We have to point out that there was a very tight security around the venue of the military parade and [still] they managed to infiltrate."
The security breach comes only two months after an attack on the Serena hotel in the diplomatic area of Kabul, she said.
"There have been reports that the government has not been able to control even 30 per cent of the Afghan territory and now with this attack it is not clear how the Taliban managed to infiltrate the security guards of the president."
Prince Ali Seraj, a political analyst, told Al Jazeera that the attack should have been expected by the authorities in Afghanistan.
"When you have all the dignitaries and the president of the country and all the ministers and ambassadors gathered together at one place, such an attack should have been expected and I believe that the entire perimeter should have been fortified with police and security forces," he said.
|The Taliban had warned of an attack to disrupt |
the military ceremony [AFP]
"From what I heard from my people, attackers were in military uniform. It is difficult to distinguish one soldier from the other, if you are not acquainted with each other.
"A group of people dressed in military uniform can infiltrate any one of the operations and be able to do what they did. But I think tighter security and identification cards should have been in place on a day like this."
Seraj said that the attack on the event was designed to gain publicity, given that ambassadors, diplomats from the United Nations and Afghan ministers were in attendance.