Scotland will become the first country in the world to embed the teaching of lesbian, gay, bisexual, transgender and intersex rights in the school curriculum, in what campaigners have described as a historic moment.

State schools will be required to teach pupils about the history of LGBTI equalities and movements, as well as tackling homophobia and transphobia and exploring LGBTI identity, after ministers accepted in full the recommendations of a working group led by the Time for Inclusive Education (TIE) campaign. There will be no exemptions or opt-outs to the policy, which will embed LGBTI inclusive education across the curriculum and across subjects and which the Scottish government believes is a world first.

Jordan Daly, the co-founder of TIE, said the “destructive legacy” of section 28 had come to an end. This legislation, introduced in 1988, banned local authorities in the UK from “promoting” homosexuality, until it was eventually repealed in Scotland 2001 and in the rest of the UK two years later.

Daly said: “This is a monumental victory for our campaign, and a historic moment for our country. The implementation of LGBTI inclusive education across all state schools is a world first. In a time of global uncertainty, this sends a strong and clear message to LGBTI young people that they are valued here in Scotland.”

A study for TIE found that nine in 10 LGBTI Scots experience homophobia at school, and 27% reported they had attempted suicide after being bullied. The investigation also found there was little understanding in schools about prejudice against people with variations of sex characteristics and intersex bodies.

The deputy first minister, John Swinney, said: “Scotland is already considered one of the most progressive countries in Europe for LGBTI equality. I am delighted to announce we will be the first country in the world to have LGBTI-inclusive education embedded within the curriculum.

“Our education system must support everyone to reach their full potential. That is why it is vital the curriculum is as diverse as the young people who learn in our schools.”

Scotland has regularly been ranked as one of the best countries in Europe in relation to legal protections for LGBTI people, despite the fact that it decriminalised homosexuality in 1980, 13 years later than England and Wales.

In 2016, the former Scottish Labour leader Kezia Dugdale described the country as having “the gayest parliament in the world”: at the time four of Scotland’s six party leaders (Dugdale, the Conservatives’ Ruth Davidson, Ukip’s David Coburn and the Greens’ Patrick Harvie) identified as lesbian, gay or bisexual.

The announcement comes after the Guardian reported on Tuesday that women’s groups have written to the education secretary, Damian Hinds, warning that the Westminster government’s sex education plans for England were “squeamish” and doomed to failure unless radically revised.

In May, the Welsh government announced an overhaul of relationship and sex education in schools, with plans to make the subject LGBT inclusive and embed it across the curriculum rather than teaching it separately.

• The headline on this article was amended on 9 November 2018 to more accurately reflect the detail of the policy.