Afghan intelligence chief Asadullah Khalid has been wounded in a Taliban suicide bombing in central Kabul.
The National Directorate of Security (NDS) chief was injured in his lower body by the blast, interior ministry officials told the BBC.
The blast took place in the Taymeni area. The Taliban said the attacker had posed as a peace messenger.
It is unclear how the Taliban managed to get so close to one of the top targets in the country.
The bombing took place in one of many guesthouses used by Mr Khalid, who sources say has been changing location regularly to reduce the risk of attack.
There have been conflicting reports about the extent of his injuries.
An intelligence official told the BBC that Mr Khalid was “safe” but did not elaborate on his condition. However, a Western diplomat told the AFP news agency that Mr Khalid had been seriously wounded.
Afghan officials also told AFP that he was now in hospital receiving blood transfusions.
Afghan President Hamid Karzai said that Mr Khalid was being operated on and doctors had told him that the intelligence chief was “doing well”. He described the attack as “a cowardly act of terrorism”.
The attack is similar to a suicide bombing in September 2011 that killed the chairman of the Afghan High Peace Council, Burhanuddin Rabbani, officials say.
Mr Rabbani was killed at his home by a suicide attacker carrying a bomb believed to have been concealed in his turban.
Mr Khalid has been in the job as intelligence chief since September.
He has a reputation for being fiercely anti-Taliban.
Mr Khalid is a close ally of President Karzai and a vehement critic of the Taliban
“Asadullah Khalid was the main target,” said Taliban spokesman Zabihullah Mujahid in a statement, in which he added that a “number of spies have been killed and wounded”.
Mr Khalid has been known to move regularly from residence to residence in Kabul for security reasons.
He survived an attempt on his life in the volatile southern province of Kandahar in October 2011 while serving as the minister of border and tribal affairs.
He also survived a roadside bombing when he was governor of Kandahar in 2008.
Mr Khalid was nominated by President Karzai to head the NDS despite allegations of human rights abuses.
Amnesty International accused Mr Khalid of “involvement in numerous alleged acts of torture and other grave human rights violations” in the past decade while serving as governor of Ghazni province from 2001-05 and in Kandahar province from 2005-08.
“There are also credible allegations that Khalid was involved in the bombing of a vehicle that killed five UN workers in Kandahar in April 2007,” Amnesty said in a statement released in September.
The intelligence chief has also been accused of running a torture prison while he was governor of Kandahar.
But Mr Khalid has steadfastly denied any human rights violations.