Hawaii is ending the sale of sunscreen containing two chemicals believed to harm coral reefs. Gov. David Ige on Tuesday signed legislation which makes Hawaii the first U.S. state to enact a ban on oxybenzone and octinoxate.

"This is just one small step toward protecting and restoring the resiliency of Hawaii's reefs," Ige said at a signing ceremony for the bill, which takes effect in 2021. He said the state would need to continue other efforts to protect coral, including fighting invasive species, pollution from land runoff and climate change.

Sunscreen containing oxybenzone and octinoxate will only be available to those with a prescription from a physician. Others will have to buy sunscreens without these chemicals or bring their own sunscreen with them to Hawaii.

Get Breaking News Delivered to Your Inbox

Scientists have found the two substances can be toxic to coral reefs, which are a vital part of the ocean ecosystem and a popular draw for tourists. Both are widely used in sunscreen, with oxybenzone present in the blood of 96 percent of Americans, according to the Environmental Working Group.

State Sen. Roz Baker, who represents south and west Maui, said the bill has enormous significance because coral is such a fundamental part of a larger ecosystem important to the health of the planet.

Between 6,000 and 14,000 tons of sunscreen are released onto coral reefs every year, a 2015 paper found.

Critics say there aren't enough independent scientific studies supporting the assertion that the chemicals harm coral reefs. The group Retail Merchants of Hawaii has said it's concerned the ban will discourage people from buying sunscreen at brick and mortar stores.

But state Rep. Chris Lee, who represents the Honolulu suburbs of Kailua and Waimanalo, said the law is a necessary step to help Hawaii pass on its reefs, ocean, tourism industry and way of life to the next generation.

Leaders need to act quickly to save what coral world has left, he said. "We know the tide is against us. We've got [a] limited amount of time."