A German woman kidnapped in Baghdad this week was freed overnight and handed over to her embassy, officials from the two countries said on Friday.
"Security forces have freed activist Hella Mewis," Iraq's military spokesman Yahya Rasool said in a statement.
Iraq's interior ministry said a joint task force, including the elite Falcons intelligence forces and federal police and anti-crime units, carried out the operation in east Baghdad.
Interior Minister Othman al-Ghanemi handed Mewis over to the German embassy in Baghdad, the ministry said.
A video released by the ministry showed Iraqi officials and German diplomats together with a tired-looking Mewis.
German Foreign Minister Heiko Maas said he was "relieved" that Mewis was freed, confirmed she was at the embassy in Baghdad and thanked Iraq's government.
Mewis has worked in the Iraqi capital since 2013 and was one of the few westerners who lived outside the high-security Green Zone, where most diplomatic missions are located.
She ran arts programmes at Iraqi collective Beit Tarkib and was close to many young photographers and painters.
Mewis was leaving her office in central Baghdad on Monday evening when unidentified assailants in two cars, including a white pickup truck typically used by Iraqi security forces, abducted her.
Police officers at the local station witnessed the abduction but did not intervene, the source added.
- 'Not badly treated' -
Dhikra Sarsam, a friend of Mewis, said she had been in contact with her since her release.
"She told me that she was doing well and had not been badly treated" in custody, Sarsam told AFP.
"She will go very soon to Germany."
The identity of her abductors and the reason for her kidnapping were still being investigated, as some details of her release emerged.
Mewis was found in an abandoned building, the interior ministry said.
A security source told AFP she was freed from a location in Sadr City, a densely populated district in east Baghdad where security forces have tried in vain for years to impose law and order.
"Hours after she was kidnapped, security forces detained a man who incriminated several people who (allegedly) belong to a faction close to the Hashed al-Shaabi," the source said.
The man was later released and security forces were able to pressure the kidnappers to release Mewis, the source added.
Hard-liners within the Hashed, a state-sponsored network of armed groups including many backed by neighbouring Iran, have been accused of kidnapping or intimidating Iraqi activists in the past.
The Hashed made no formal statement on Mewis's kidnapping, but on Friday a spokesman said he hoped Iraqi authorities would look into how she had been "secretly" present in Baghdad without security authorisation.
Moqtada Sadr, a populist and divisive Shiite cleric, hailed Mewis's release and called her a "guest."
- Nervous after killing -
Mewis had been worried following the killing earlier this month in Baghdad of Iraqi scholar Hisham al-Hashemi, who was supportive of last year's anti-government protests, according to Sarsam.
Large demonstrations erupted in Baghdad and Iraq's Shiite-majority south last year, railing against a government seen as corrupt, inept and beholden to Iran.
Around 550 people died in protest-related violence, including two dozen activists who were shot dead by unidentified men, usually on motorcycles.
Dozens more were kidnapped, some of whom were later released near their homes. The whereabouts of others remain unknown.
Amnesty International has slammed the incidents as "a growing lethal campaign of harassment, intimidation, abductions and deliberate killings of activists and protesters".
This year has seen a worrying spike in abductions of foreigners, who had not been targeted in several years.
On New Year's Eve, two French freelance journalists were taken hostage for 36 hours and three French NGO workers were held for two months.
In both cases, neither the kidnappers nor the conditions of the hostages' release were revealed.
Prime Minister Mustafa al-Kadhemi's government is the crosshairs of pro-Iran groups because he repeatedly tried to clip their wings when the premier was intelligence chief.
But the government has repeatedly called on armed factions to hand in their weapons and dismantle checkpoints, and analysts say this pressure may be behind the recent spike in violence in Baghdad.
Meanwhile on Friday, four rockets targeted a base used by US soldiers south of the capital without causing casualties, the army said, the latest in a series of attacks in recent months.