The mayor of London, Boris Johnson, has been accused of sexism after joking that the increase in the number of women attending university in Malaysia was down to their desire to find a husband.

Johnson, no stranger to controversy, risked accusations of sexism after he made the remark at the launch of the World Islamic Economic Forum (WIEF) at City Hall, London, where he appeared alongside the Malaysian prime minister, Najib Razak. Asked about the role of women in Islamic societies, Razak said: "Before coming here, my officials have told me that the latest university intake in Malaysia, a Muslim country, 68% will be women entering our universities."

Johnson interrupted him, suggesting the female students went to university because they "have got to find men to marry". Laughter can be heard from audio from the meeting, but the mayor has since been reprimanded for the comments.

Sophia Furber, a reporter at Estates Gazette who was at the forum, tweeted that the mayor's comment had made some in the room uncomfortable. "It was painful," she wrote. "I don't think the Malaysians thought it was as funny as Boris did."

She later told the Guardian: "I think the Malaysians were a bit taken aback by the remark. I felt that the comment was a bit naff and not in the spirit of the event, since the Malaysians/WIEF came across as very sincere about promoting women in business.

"There were some groans from audience members – especially from professional, hijab-wearing ladies."

The Evening Standard's political correspondent Pippa Crerar, who was also at the forum, called it "a stupid comment but it was clearly a joke and was met with the groans it deserved". The Everyday Sexism campaign group, which documents incidences of sexism, called the comments "pathetically archaic, unacceptably sexist and hopelessly out of touch".

Labour's shadow equality minister, Kate Green, called on the mayor to apologise. "Boris Johnson may think his buffoonery allows him to get away with his outdated opinions but this isn't funny. These comments are insulting to the women across the country and across the world who have gone to university, worked hard and used their talents to get on," she said.

Soon after the comments were reported, the official @MayorofLondon Twitter account was bombarded by female graduates informing Johnson of the reasons they went to university. "Hey Boris, I've managed to finish my degree with a first but no husband, can you give me some dating advice?" asked Caitlin Gleeson, while @charcoaltache asked: "I went to uni twice and still don't have a husband. Is it because I studied science? Advice appreciated."

Male tweeters also added to the debate. Chris Jones tweeted: "If there's one thing I can't stand about uni it's all the women trying to marry me."

London assembly's Labour group leader, Len Duvall, said the mayor's comments were "beyond offensive". He said: "It beggars belief that he would say a thing like this. He has insulted over half the country and has done down the hard work of millions of women in the UK who have gone to university, are studying at the moment and work a damn sight harder than he does.

"Boris's view of the world was formed on the playing fields of Eton and in the Bullingdon Club. Sexism of any kind is unacceptable."

Last year Johnson denied being sexist following allegations that he was disrespectful to female politicians. The mayor was confronted with a dossier of public exchanges made during his four-year term, to highlight concerns over his "disrespectful, patronising way at meetings" towards female assembly members that "you do not display when dealing with male assembly members", according to Jennette Arnold, Labour chair of the assembly.

Johnson responded: "I have not been more robust towards female rather than male assembly members and I do not believe I have been remotely sexist."