The interior ministry confirmed his replacement as Abdul Rahman Rahimi, former police chief in Balkh province.
Gen Zahir resigned last week after presiding over a dramatic rise in militant attacks in recent months.
His spokesman sparked confusion days later by claiming his resignation had been rejected.
Interior ministry spokesman Sidiq Sidiqi said: "Abdul Rahman Rahimi, the former police chief of Balkh, is appointed as Kabul police chief and General Zahir is appointed as the head of the counter crime department.
"So far no-one is appointed as Balkh police chief and soon another general will be appointed there."
Gen Zahir gave no reason for his resignation, but he had faced increasing pressure, with insurgents carrying out nine deadly attacks in Kabul in the past two weeks.
The latest in a string of attacks targeted a compound used by a US-based charity on Saturday, killing three South Africans.
Last week, two American soldiers and two British embassy workers were killed in separate attacks, with dozens of Afghans also killed and injured.
Gen Zahir was himself the target of an attack in early November, when a suicide bomber infiltrated his offices and killed his deputy.
Afghan troops are preparing to take over national security before the withdrawal of foreign combat troops at the end of the month.
The Taliban stepped up attacks against foreign nationals, civilians and Afghan soldiers in recent months, raising concerns over the Afghan army's ability to protect the country from insurgents.
President Ashraf Ghani, who took power in September, has vowed to bring peace after decades of conflict.
On Sunday, he ratified security deals allowing some 12,000 Nato soldiers to remain for training and advisory purposes, after the withdrawal of foreign combat troops on 31 December.
A separate US-led force will assist Afghan troops in some operations against the Taliban.
A new police chief has been installed in the Afghan capital, Kabul, ending days of confusion over the fate of incumbent Gen Zahir Zahir.