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.

The Welsh government has agreed to pay Â£20,000-a-year for three years for a site to store the 15th Century vessel discovered in 2002.
It comes after Newport council said it planned to stop its funding due to budget cuts.
The new site will allow freeze-drying of the ship's remaining timbers to continue, completing its conservation.
Supporters of the Newport Ship raised concerns about its future in August when it emerged there was no plan in place for an alternative home after the lease on its current building expires in October.
Council officers have since looked at six options, including relocating it to a National Museum of Wales facility in Nantgarw, storing it in a shared warehouse in Pill or at vacant council-owned premises.
It also considered disposing of the timbers, but a report to councillors says that would leave the authority "accountable for the destruction of one of the most remarkable archaeological finds of the last 50 years".
Instead the report recommends renting a warehouse to store the ship, which would be part funded with a grant offered by the Welsh government.
This would allow freeze-drying of the ship's remaining untreated timbers to be completed and allow the public to visit it, as they do on open days held at its current home in Maeglas.
It is hoped the Friends of Newport Ship, a charity which supports the conservation project, will eventually take over its management.
The 500 year-old vessel was found on the banks of the River Usk during construction of the Riverfront theatre 12 years ago.
Dating back to 1460, it is the most complete surviving example of a ship of its time and experts think it was used for trading along the Atlantic seaboard.
It is thought it was built in south-west France, the Basque country or Portugal, but how it came to rest in Newport remains a mystery.
A new police chief has been installed in the Afghan capital, Kabul, ending days of confusion over the fate of incumbent Gen Zahir Zahir.
[NEXT_CONCEPT]
A new home could soon be found for Newport's medieval ship, safeguarding its future restoration.