NASA visualizes data of ozone concentrations over the southern hemisphere for each year from 1979-2013. Each image is the day of the year with the lowest concentration of ozone. A graph of the lowest ozone amount for each year is shown. There is no data from 1995. (NASA's Goddard Space Flight Center)

Finally, some good news about the environment: The giant hole in Earth’s ozone layer is shrinking.

The atmospheric layer that protects Earth’s inhabitants from the sun’s harmful ultraviolet rays is slowly rebuilding itself, according to a United Nations report published Wednesday.

Scientists credit the recovery to the phasing out of chemicals used in refrigerators, air conditioners and aerosol cans in the 1980s.

“It’s a victory for diplomacy and for science and for the fact that we were able to work together,” said chemist Mario Molina, who won a Nobel Prize for his research into the ozone layer.

It was in the 1970s that scientists first realized chlorofluorocarbons (CFCs) had worn the ozone layer thin above Antarctica. Studies have shown that, left unchecked, ozone destruction could cause higher rates of skin cancer, disrupt plant growth and destabilize the aquatic food chain thanks to an increase in harmful ultraviolet rays.

Fortunately, the world’s policymakers were proactive about environmental problems back then. Leaders agreed in 1987 to the Montreal Protocol, which phased out CFCs.

At the time, industry objected, saying the science was speculative and that regulation would be costly and lead to lost jobs.

Sound familiar?

Once chemical companies figured out how to make safe substitutes for CFCs, industry was less resistant to the proposed precautionary measures. DuPont and other producers eventually promised to phase out production and supported international controls.

This undated image provided by NASA shows the ozone layer over the years, Sept. 17, 1979, top left, Oct. 7, 1989, top right, Oct. 9, 2006, lower left, and Oct. 1, 2010, lower right. Earth protective but fragile ozone layer is finally starting to rebound, says a United Nations panel of scientists. Scientists hail this as rare environmental good news, demonstrating that when the world comes together it can stop a brewing ecological crisis. (AP Photo/NASA) This undated image provided by NASA shows the ozone layer over the years, Sept. 17, 1979, top left, Oct. 7, 1989, top right, Oct. 9, 2006, lower left, and Oct. 1, 2010, lower right. Earth protective but fragile ozone layer is finally starting to rebound, says a United Nations panel of scientists. Scientists hail this as rare environmental good news, demonstrating that when the world comes together it can stop a brewing ecological crisis. (AP Photo/NASA)

Nearly 30 years after the Montreal Protocol was signed, the ozone layer is just starting to heal, according to a panel of 300 scientists that reports every four years to the United Nations on the subject.

It will take until 2050 for the ozone layer in the mid-latitudes to return to relatively healthy 1980s conditions, the U.N. report said. Around the Antarctic, where the ozone layer is the most damaged, it will take until 2075.

This is the first time scientists have detected a measurable increase in ozone, World Meteorological Organization senior scientific officer Geir Braathen told Reuters.

The ozone layer remains about 6 percent thinner than in the 1980s. Damaging chemicals still linger in the atmosphere. While it has stopped growing, the hole over the Antarctic still appears each year.

The hole was largest in 2006 at about 30 million square kilometers. It’s now about 20 million square kilometers, Reuters said — big enough for the moon to pass through, though its size varies from year to year because of atmospheric temperature changes.

Achim Steiner, executive director of the U.N. Environment Program, called the effort to get rid of ozone-destroying substances “one of the great success stories of international collective action in addressing a global environmental change phenomenon.”

The report, however, did have some bad news.

Carbon tetrachloride, one of the ozone-depleting chemicals that should have been phased out, was found in increased amounts in the past decade, which could means it is still being used illegally.

Also, Massachusetts Institute of Technology atmospheric scientist Susan Solomon told the Associated Press the chemicals that replaced CFCs — the stuff blamed for damaging the ozone layer in the first place — are contributing to another environmental problem: global warming.

Paradoxically, the heat-trapping greenhouse gases believed to contribute to global warming are actually helping rebuild the ozone layer. Paul A. Newman, who co-chairs the U.N. panel, told the AP higher levels of carbon dioxide and other gases help cool the upper stratosphere, which increases the amount of ozone.

“The challenges that we face are still huge,” Steiner said. “The success of the Montreal Protocol should encourage further action not only on the protection and recovery of the ozone layer but also on climate.”