Al-Qaida has sent a message to the Iranian president, Mahmoud Ahmadinejad, asking him to stop spreading conspiracy theories about the 9/11 attacks.

Iranian media on Wednesday reported quotes from what appears to be an article published in the latest issue of the al-Qaida English language magazine, Inspire, which described Ahmadinejad's remarks over the 11 September attacks as "ridiculous".

In his UN general assembly speech last week, Ahmadinejad cast doubt over the official version of the 2001 attacks.

"The Iranian government has professed on the tongue of its president Ahmadinejad that it does not believe that al-Qaida was behind 9/11 but rather, the US government," the article said, according to Iranian media. "So we may ask the question: why would Iran ascribe to such a ridiculous belief that stands in the face of all logic and evidence?"

Ahmadinejad said in New York that the "mysterious September 11 incident" had been used as a pretext to attack Afghanistan and Iraq. He had also previously expressed scepticism at the US version of events.

"By using their imperialistic media network which is under the influence of colonialism, they threaten anyone who questions the Holocaust and the September 11 event with sanctions and military actions," said Ahmadinejad.

The al-Qaida article insisted it had been behind the attacks and criticised the Iranian president for discrediting the terrorist group.

"For them, al-Qaida was a competitor for the hearts and minds of the disenfranchised Muslims around the world," said the article published in the Inspire magazine. "Al-Qaida … succeeded in what Iran couldn't. Therefore it was necessary for the Iranians to discredit 9/11 and what better way to do so? Conspiracy theories."

Al-Qaida also accused Iran of hypocrisy over its "anti-Americanism".

The article said: "For Iran, anti-Americanism is merely a game of politics. It is anti-America when it suits it and it is a collaborator with the US when it suits it, as we have seen in the shameful assistance Iran gave to the US in its invasion of Afghanistan and in the Shia of Iraq, backed by Iran, bringing the American forces into the country and welcoming them with open arms."

During his visit to New York, Ahmadinejad also changed his position on gay people in Iran. He had previously famously said: "We don't have homosexuals [in Iran] like you do in your country. This does not exist in our country."

But according to the American news website the Daily Beast, in a meeting with a number of journalists last week, he said: "In Iran, homosexuality is seen as an ugly act … There may be some people who are homosexuals who are in touch with you. But in Iranian society they're ashamed to announce it so they're not known. This is an act against God and his prophets. But we as the government can't go out and stop people."