Young and educated Malaysians overwhelmingly accept of LGBTI people, a new survey has found.

The Oriental Daily News conducted the poll following the US Supreme Court’s June ruling that legalized gay marriage nationwide.

The results show that 83% of Malaysians aged 18 to 30 and 84% between the ages of 31 and 45 would accept gay friends or colleagues.

However, half of respondents aged 46 to 60 and only 24% of those above 60 said they would not.

Gay sex is illegal in the Muslim-majority country under a colonial anti-sodomy law and punishable by fines, whipping and/or up to 20 years in prison.

The newspaper noted that 83% of respondents with a university or college education said they could accept gay friends or colleagues, compared with 59% of people who only went to elementary school.

Women were also more accepting, with 81% saying they would accept a friend or colleague if they came out, compared with 59% of men.

One gay respondent said LGBTI people were the target of jokes in the workplace and social circles, and they had no choice but to hide their sexuality in order to protect themselves.

Nearly half of respondents (45%) said gay people were marginalized or discriminated against.

Some 43% of respondents support gay marriage, while 32% ‘do not support or oppose.’

Of the respondents who opposed gay marriage, 43% believe it is contrary to nature, 21% think it is immoral and 21% said they could not accept it on religious grounds.

The Oriental Daily News polled 450 people from eight states and the capital Kuala Lumpur, 44% of whom were men and 56% women.

However, the survey may not be representative of the country as a whole as 62% of respondents were university graduates, compared with only 34.45% of the total population.

According to a 2104 poll by Pew Research Center, 88% of Malaysians thought homosexuality was morally unacceptable.