NEW YORK — A correspondent for The New York Times who was ordered to leave Afghanistan over a story he wrote about that country’s recent presidential election can return after its newly inaugurated president ordered the previous administration’s decision reversed.

Mohammad Daoud Sultanzai, an adviser to Afghan President Asharf Ghani Ahmadzai, said Sunday the country’s attorney general has been told to allow Matthew Rosenberg back into Afghanistan.

Sultanzai said the decision was made at the beginning of the Eid al-Adha holiday. “During our (presidential) campaign, we committed to respecting the freedom of the media,” he said. “When a journalist has a source for an article he is writing, he should be allowed to write it, according to the law.”

Asked about the situation in a Facebook message, Rosenberg confirmed he is being allowed to return to Afghanistan.

Rosenberg was told in August by former President Hamid Karzai’s administration that he had to leave and could not return. The expulsion was over a story about a group of officials considering seizing power and forming a government over the then-unresolved presidential election. Rosenberg refused to reveal his sources, and officials accused the piece of threatening the country’s stability.

The Times had no immediate comment.

Only subscribers are eligible to post comments. Please subscribe or to participate in the conversation. Here’s why.

Use the form below to reset your password. When you've submitted your account email, we will send an email with a reset code.