Prime Minister Malcolm Turnbull says he wouldn't have invited a senior Imam to the PM's official residents for a multi-faith Iftar dinner had he known the guy was a homophobe.

"Had I known that the sheikh had made those remarks, he would not have been invited to the Iftar," Malcolm later said.  "I regard as unacceptable and I will always condemn any remarks which disrespect any part of our community, whether it is on the basis of their sexuality, their gender, their race, their religion," he added.

Australian National Imams Council president Sheikh Shady Alsuleiman was one of 75 mostly Muslim guests invited to the prime minister's official Sydney residence on Thursday night.  During the Iftar, which is the meal at which Muslims end their daily Ramadan fast at sunset, a reporter contacted the OM's media team about a sermon that Mr. Alsuleiman uploaded to social media in 2013, in which states that homosexual acts "are evils actions that bring upon evil outcomes to our society". 

Mr. Turnbull says he then condemned those comments at the dinner, and "encouraged" Alsuleiman "to reflect very deeply on his remarks."

Alsuleiman didn't respond to reporters' requests for comment on Friday. 

It's a misstep for the Turnbull government, so soon after the massacre of 49 club goers at an Orlando, Florida gay bar.  And it comes as the Turnbull government is already being criticized for refusing to allow its own lawmakers vote to allow gay marriage before the election on 2 July in which it is seeking reelection.