By Kylie Morris
BBC Kabul correspondent
Afghanistan's President, Hamid Karzai, has ordered the release of two journalists accused of defaming Islam, but says they must stand trial for blasphemy.
The journalists' article also criticised members of the Northern Alliance
The men, who write for the weekly newspaper Aftab, were arrested last week after the publication of an article headlined Holy Fascism, which attacked what it described as "crimes committed in Islam's name."
It also criticised some members of the anti-Taleban Northern Alliance.
The arrest of the newspaper's editor, Mir Hussein Mahdawi, and his assistant Ali Reza, drew criticism from human rights groups and within media circles in Afghanistan.
They described the journalists' detention as politically motivated and said it showed a failure on the part of the Afghan government on the issue of freedom of expression.
But President Karzai says the men will still face trial, although he has ordered that they be released from detention.
He warned that press freedom does not protect journalists if they violate the beliefs of the Afghan people.
The president defended his government's track record on the media, saying he and his ministers have been criticised and abused by the press but have not taken any action.
It is our job to protect the Afghan people's beliefs, religious beliefs, and the basics of the constitution as well as press freedom
"That part of press freedom is absolutely respected - we will do that," he told journalists.
"But when it comes to the Afghan people's beliefs, religious beliefs, and the basics of the constitution, it is also our job to protect that."
Mir Hussein Mahdawi is well known for his reformist views, but the article which drew the ire of the public prosecutor's office asked why after 1,400 years of Islam, there was no sign of progress or development in Muslim society.
It also criticised conservative Islamic figures in Afghanistan.
The detention of the journalists follows criticism of the current press law.
The United Nations has, in the past, called for a thorough review of the legal system in Afghanistan to promote freedom of expression and protect the rights of journalists.
Until the pair come to trial they have been assigned security guards in order to protect them against people who, the president says, might want to use the issue to cause trouble.
On Monday the US-based Human Rights Watch group accused President Karzai of not doing enough to protect freedom of speech.
The French group Reporters Without Borders and the US-based Committee to Protect Journalists have also condemned the arrests.
Around 150 publications have appeared - mostly in Kabul - in the 18 months since the fall of the Taleban regime.
Rules imposed by the Taleban turned Afghanistan into a country without news or pictures.
Despite the comparative freedom citizens enjoy now, the Washington-based group, Human Rights Watch, last month accused Afghan security personnel of creating "a climate of fear" in which journalists were afraid to publish articles criticising the country's leaders.