Australia's prime minister says he would not have invited a senior imam to a multi-faith dinner if he had been aware of the Muslim cleric's anti-gay preaching.

Malcolm Turnbull on Thursday became the first Australian prime minister to host an Iftar — the meal at which Muslims end their daily Ramadan fast at sunset.

Among the guests was Sheikh Shady Alsuleiman.

The Australian newspaper reported Alsuleiman had said in a sermon uploaded on to social media in 2013 that homosexual acts "are evil actions that bring upon evil outcomes to our society."

Turnbull said on Friday he became aware of Alsuleiman's comments during the course of the dinner when a journalist contacted the prime minister's office. Turnbull said he then condemned those comments.

Alsuleiman could not be immediately contacted for comment.