Canada condemned a deadly attack on Wednesday that left a Canadian injured and five UN staff members dead in the Afghan capital.

Three Taliban attackers, two security guards and an Afghan civilian were also killed.

Taliban gunmen stormed a UN guest house in the Shar-e-Naw area of Kabul during the early hours of Wednesday morning. The attackers were dressed in police uniforms, wore suicide vests and were armed with grenades and machine-guns.

The assault lasted two hours and came just over a week before Afghans are supposed to be headed to the polls, to take part in a Nov. 7 runoff election that the Taliban opposes.

Forty people had been staying at the guest house, some of whom were seen jumping from upper-storey windows when a fire later broke out inside. It is not yet known what caused the blaze.

U.S. trucking contractor John Turner said he held off attackers with a Kalashnikov rifle, while guests fled the scene through a laundry room in the guest house.

Taliban spokesperson Zabiullah Mujahid said three militants were responsible for the attack on the guest house.

He said it was the "first attack" that the Taliban had recently warned of, threatening anyone working on the upcoming election.

In the end, six UN workers lay dead, along with three attackers, two security guards and an Afghan civilian. The U.S. Embassy confirmed that one of the dead was an American.

At least nine other people were wounded, including a Canadian.

In Ottawa, Foreign Affairs Minister Lawrence Cannon said Canada would not be deterred in its Afghan mission and that Afghans should not be discouraged from taking part in the upcoming runoff vote.

"These cowardly acts...will not deter the international community from supporting Afghans as they exercise their right to vote," Cannon said in a statement.

"We encourage all Afghans to exercise their hard-won right to determine the future of their country by participating in the second round of voting."

Foreign Affairs said the unnamed Canadian received leg injuries during the attack and is now receiving assistance from consular officials.

Afghan President Hamid Karzai called the attack "an inhuman act" and he called on the army and police to increase security around all international institutions.

UN spokesperson Adrian Edwards said officials were still trying to account for the whereabouts of several other staffers who were staying at the guest house.

"This has clearly been a very serious incident for us," Edwards said. "We've not had an incident like this in the past."

He said the UN would have to evaluate "what this means for our work in Afghanistan."

But Kai Eide, the chief of the UN mission in Afghanistan said the attacks "will not deter the UN from continuing its work."

Police officer Gul Mohammad said the bodies of the attackers were removed from the guest house and sent for autopsies.

Elsewhere in Kabul, separate rocket attacks targeted a five-star hotel and the presidential palace.

Two rockets hit the hotel, though one failed to detonate. Guests and employees had to flee to the hotel's basement when the unexploded rocket filled the lobby with smoke.

A presidential spokesperson said the rocket that hit the "outer limit" of the palace, but did not cause any injuries.

Afghan voters are scheduled to return to the polls for the runoff election between Karzai and former foreign minister Abdullah Abdullah in only 10 days.

A second election was called after a UN-backed panel threw out nearly one-third of the votes cast for Karzai in the Aug. 20 election because of problems with fraud.

In order for Karzai or Abdullah to win the runoff, they will need to garner at least 50 per cent of the vote.

The Taliban have warned Afghans to stay away from the polls on election day, or risk being attacked.

With files from The Associated Press and The Canadian Press