The US journalist Shelly Kittleson, who was kidnapped from a Baghdad street corner last week, has been released, according to an Iraqi official with direct knowledge of the situation.

Kittleson was freed in the afternoon, said the official, who spoke to the Associated Press on condition of anonymity because he was not authorized to comment publicly. He did not share her current whereabouts but said that before her release, she had been held in Baghdad.

The powerful Iran-backed Iraqi militia Kataib Hezbollah said in a statement earlier in the day it had decided to free Kittleson, who was abducted on 31 March.

The group said its decision came “in appreciation of the patriotic stances of the outgoing prime minister”, Mohammed Shia al-Sudani, without giving more details. It added: “This initiative will not be repeated in the future.”

The statement added a condition – that Kittleson must “leave the country immediately” upon her release.

Kataib Hezbollah had not previously acknowledged that it was the one responsible for Kittleson’s abduction, although US and Iraqi officials had pointed fingers at the group.

Two officials within the militia, who spoke on condition of anonymity because they were not authorized to comment publicly, told the AP that in exchange for freeing Kittleson, several members of the group who had previously been detained by Iraqi authorities would be released.

Kittleson, 49, a freelance journalist, had lived abroad for years before the kidnapping, using Rome as her base for a time and building a respected journalism career across the Middle East, particularly in Iraq and Syria. Like many freelancers, she often worked on a budget and without the protections afforded by large news organizations to staff.

She had entered Iraq again shortly before her abduction. US officials have said that they warned her multiple times of threats against her, but that she did not want to leave.