The protective ozone layer in the earth’s upper atmosphere has stopped thinning and should largely be restored by mid century thanks to a ban on harmful chemicals, UN scientists said on Thursday.

The “Scientific Assessment of Ozone Depletion 2010” report said a 1987 international treaty that phased out chlorofluorocarbons (CFC) — substances used in refrigerators, aerosol sprays and some packing foams — had been successful.

Ozone provides a natural protective filter against harmful ultra-violet rays from the sun, which can cause sunburn, cataracts and skin cancer as well as damage vegetation.

First observations of a seasonal ozone hole appearing over the Antarctic occurred in the 1970s and the alarm was raised in the 1980s after it was found to be worsening under the onslaught of CFCs, prompting 196 countries to join the Montreal Protocol.

“The Montreal Protocol signed in 1987 to control ozone depleting substances is working, it has protected us from further ozone deplation over the past decades,” said World Meteorological Organisation head of research Len Barrie.

“Global ozone, including ozone in the polar region is not longer decreasing but not yet incresing,” he told journalists.

The 300 scientists who compiled the four yearly ozone assessment now expect that the ozone layer in the stratosphere will be restored to 1980 levels in 2045 to 2060, according to the report, “slightly earlier” than expected.