Jan Mohammad Khan, the former governor of southern Uruzgan province and a key ally of the embattled president, was killed in the attack along with an MP for Uruzgan, Mohammad Hashem Watanwal, said a police spokesman.
The assassination comes less than a week after the president's half-brother Ahmed Wali Karzai was shot dead by a close friend at his home in the southern province of Kandahar in an attack claimed by the Taliban.
|Pedestrians walk at the location where Jan Mohammad Khan, a senior adviser to Afghan President Hamid Karzai was murdered, in Kabul on July 18, 2011.|
Just hours before Sunday's attack, a ceremony was held in central Bamyan province marking the start of the transition of security duties from NATO forces to Afghans, a process aimed at leaving the country free of foreign troops by 2014.
Sunday was also the last day in Afghanistan for top US commander General David Petraeus.
Police were still searching for one of the attackers at the residence near the parliament building early Monday, but the area was quiet according to witnesses, after sporadic gun battles lasting more than four hours.
Kabul police spokesman Hashmat Stanikzai said at least one of the gunmen in Sunday's raid was dead and it was not clear whether the rest of Khan's family had escaped or were stuck inside the besieged residence.
"JMK (Jan Mohammad Khan) and Watanwal have been martyred and also one of the attackers has been killed," he told AFP, adding that the attack began at 8:00 pm (1530 GMT) and that at least one attacker was still at large.
Interior ministry spokesman Siddiq Siddiqi said one police officer had been injured in the siege.
"They were not suicide bombers, they were carrying weapons," said Siddiqi, adding that no foreign forces were taking part in the operation.
A senior intelligence official speaking anonymously said it was believed that three people attacked Khan's residence.
A government official speaking on condition of anonymity said: "He (Khan) was very close to Karzai. He was as important as AWK (Ahmed Wali Karzai)."
Like Karzai, Khan hailed from a powerful family from the Popalzai tribe in Afghanistan's restive south and had been given the role of senior adviser for tribal issues after being sacked from his governorship over corruption claims.
Experts say Khan had a reputation for brutality and double-dealing with tribal rivals, falsely accusing some of being Taliban, and Dutch forces taking over Uruzgan operations in 2006 insisted on his removal as governor.
According to the independent website afghan-bios.info, Khan's nephew runs a 3,000-strong militia in Uruzgan that he had inherited from his uncle.
Khan escaped a previous assassination attempt on August 4 when a motorcycle bomb exploded by his convoy in the southern province.
His death could further inflame the volatile politics of southern Afghanistan, where the Taliban are battling US-led troops for control of the area.
Analysts have already warned that the killing of Wali Karzai may trigger a turf war for control of the critical southern heartland that could embolden the Taliban and reverse NATO gains.
The deaths come at a critical juncture, just days after 3,000 Canadian troops ended their combat mission in Kandahar and in the same week that Washington began troop drawdowns, a gradual process due to end in late 2014.
A ceremony was held on Sunday to mark the first of seven areas to pass control from foreign to local forces this week, and the killings are likely to fuel doubts about the readiness of Afghans to take care of the country.
Last month the Taliban mounted a brazen attack on the Intercontinental hotel in the heart of Kabul, leaving 21 people dead.
With Western allies tiring of the long war, all foreign combat troops are due to leave Afghanistan by the end of 2014 and partial drawdowns are starting this summer, with the 33,000 US "surge" troops leaving by the end of 2012.
There are around 150,000 foreign troops in Afghanistan, nearly 100,000 of whom are from the United States, fighting the nearly 10-year war.