The police commander for northern Afghanistan has been killed in a suicide bomb attack on the provincial governor's compound in Takhar.
Gen Mohammad Daud Daud is one of at least six people killed in the attack, claimed by the Taliban.
Two German soldiers were killed and Gen Markus Kneip, commander of foreign troops in north Afghanistan, wounded.
Afghanistan has seen a series of attacks in recent months by militants on police and military targets.
Takhar provincial Governor Abdul Jabar Taqwa is among those wounded, officials said.
Gen Daud was former military commander of the Northern Alliance, the Afghan forces who fought the Taliban.
The latest attack will be seen as significant because it has struck an area of the country's north which has been seen as relatively secure.
One intelligence official who survived the attack in Taloqan told the BBC's Bilal Sarwary that Gen Daud had left a meeting and was heading to the second floor of the building when there was a huge explosion.
"There was fire. Daud and the police chief of Takhar province were laying on the ground. There were shouts and crying. There was chaos all over the place," the official said.
Intelligence officials said Gen Daud had been warned about a threat to his life and that security was extremely tight.
However, the attacker was wearing a police uniform and passed several security checks.
Gen Daud was in charge of all interior ministry forces in northern Afghanistan and is the most senior figure to be killed so far in a Taliban "spring offensive".
He was highly thought of by Nato because he got the job done, correspondents say.
Last week he told our correspondent, Bilal Sarwary: ''The Haqqanis and Taliban groups have tried to offer money to some of the police. Some of my guards.
"I am very vigilant. I have made a lot of changes in my movements and who guards the front and rear of the my headquarters. But I have to travel all over northern Afghanistan, to different provinces. I can't stop doing this.''
Gen Daud was a former deputy interior minister for narcotics.
He also served as the bodyguard to Ahmad Shah Massoud, who commanded the Northern Alliance.
At least six people were killed in the explosion, including Gen Daud and the provincial police chief Shah Jahan Nuri.
At least 10 Afghans were injured, including the governor, he added.
Early reports said three German soldiers had been killed, but this was later corrected to two, with three wounded.
A spokesman for the Nato-led International Security Assistance Force (Isaf) confirmed that Gen Kneip was in the compound at the time but "was not killed".
German troops are based in neighbouring Kunduz province, and have oversight of Takhar.
The province was until recently a relatively quiet area of Afghanistan, but tensions rose in May after a Nato-led night raid in Taloqan which killed four people.
A crowd of 2,000 people took to the streets to protest against the attack, claiming the victims were civilians.
Nato said the group were insurgents.
Police opened fire on the demonstrators, killing 12 people and wounding 80.
A smaller protest the following day saw the provincial police chief's compound attacked.