Next time you're at the beach, give the ocean a big thanks.

For decades, the Earth's oceans have absorbed vast quantities of carbon dioxide that would have remained in the atmosphere. This has prevented the full impact of global warming from taking effect, a new study says.

Carbon dioxide, emitted when fossil fuels are burned, is the greenhouse gas scientists say is most responsible for global warming. The gas is at its highest level in our atmosphere in thousands, perhaps millions, of years.

Fortunately, researchers say the oceans have absorbed about 31 percent of the carbon that humans are emitting into the atmosphere. That's a whopping 2.6 billion tons per year. "It’s a huge service the oceans are doing,” study co-author Richard Feely told the Seattle Times. “That significantly reduces global temperature.”

But there is a cost to the ocean: carbon dioxide dissolved into the sea causes the water to acidify, which limits how shellfish and corals build their skeletons; it also affects the health of other fish and marine species. This process is known as ocean acidification, which is sometimes called the "quiet threat" from climate change.

"The increasing load of carbon dioxide in the ocean interior is already having an impact on the shellfish industry, particularly along the U.S. West Coast,” said Feely, a scientist at the National Oceanic and Atmospheric Administration (NOAA).

But how long will the seas keep buffering us from runaway heating of the atmosphere?According to the study, the more carbon dioxide is in the atmosphere, the more is absorbed by the oceans – until it becomes eventually saturated.

More:Carbon dioxide in our atmosphere may soar to levels not seen in 56 million years

More:UN's 'dire' warning: Act now on Earth's environment as human health 'increasingly threatened'

"At some point the ability of the ocean to absorb carbon will start to diminish," Jeremy Mathis, a NOAA scientist and study co-author told Mashable. "It means atmospheric carbon dioxide levels could go up faster than they already are."

And though that may be decades away at the earliest, that means air temperatures up here on land could eventually reach absurdly hot levels.

The study was published Thursday in the peer-reviewed journal Science.