The German Foreign Ministry said the woman, 31-year-old Christina Meier, had been taken to the German Embassy in Afghanistan.
An Interior Ministry spokesman, Zemari Bashari, today told RFE/RL's Radio Free Afghanistan that Afghan national police and national security forces freed Meier in a joint operation on August 19 in the seventh district of Kabul.
"Afghan national police and national security forces succeeded in a joint operation to release this [German] woman in [Kabul's western] seventh district area," Bashari said. "And regarding the case, a group of suspected people has been also arrested and the investigation is continuing."
Police are still searching for possible accomplices.
Bashari said the kidnappers are thought to be members of a criminal gang rather than Taliban militants.
"The preliminary reports suggest that she was kidnapped by a criminal group who took her as a hostage for their own goals," Bashari said. "It is thought that the group kidnapped her to obtain [ransom] money."
Investigators say the group was demanding $1 million for the woman's release.
Amrullah Saleh, the head of the Afghan intelligence service, said at least three suspected kidnappers have been arrested -- including a suspected gang leader who had been freed from a prison in northern Afghanistan two months ago.
Meier is the first foreigner to be seized within the city limits of Kabul in about two years.
The boldness of the kidnappers has raised concerns among other foreigners about their safety in the Afghan capital.
Meier had been dining with her husband at a fast-food restaurant close to the offices of several nongovernmental organizations in Kabul on August 18.
Authorities say a man with a pistol simply walked up to the couple's table, pointed a pistol at the woman's head, and took her away.
Meier had been working for a Christian aid organization, Ora International.
Nineteen South Korean Christian aid workers who were kidnapped in nearby Ghazni Province on July 19 are still being held by Taliban captors in Afghanistan. The militants have killed two members of the group and released another two, and are demanding that Kabul release imprisoned militants in exchange for the lives of the rest of the group.
In another hostage situation, Taliban fighters also have killed one of two male German engineers they seized in July. They are still holding the other German and four of his Afghan colleagues.
Those hostage takers have demanded the withdrawal of all German troops from Afghanistan in return for the German's freedom. Berlin has refused to do so.
Latest Taliban Attack
In fresh violence overnight, dozens of Taliban fighters attacked an Afghan military base in Sangin district in southern Helmand Province.
District chief Ezatullah Khan said the rebels met "tough resistance," resulting in the deaths of 10 militants. Khan said the rebels withdrew, leaving their dead comrades on the battlefield.
Helmand Province, the heart of Afghanistan's opium-growing region, has been at the center of battles between the Taliban and international forces in recent months.
(with material from agency reports)