(CNN) Greenland's largest and most critical glacier, Jakobshavn, is gaining ice, according to NASA researchers.

Although this finding is surprising and temporarily good news for the glacier, limiting its contribution to sea level rise, the reason for the ice accumulation might spell disaster in the long run.

For two decades, Jakobshavn sustained remarkably consistent thinning that scientists thought would continue, if not accelerate, due to large-scale warming of the polar atmosphere and oceans -- but that rate dramatically slowed in 2014, and the glacier actually thickened between 2016 and 2017 and again between 2017 and 2018, according to a study published Monday in the journal Nature.

"At first we didn't believe it," said Ala Khazendar, the lead NASA scientist on the study. "We had pretty much assumed that Jakobshavn would just keep going on as it had over the last 20 years."

A close-up of the Jakobshavn glacier.

Jakobshavn Isbrae, the full name of the glacier along Western Greenland's coast, has been Greenland's fastest-flowing and largest ice-losing glacier over the past 20 years, making it by far the single largest contributor to sea level rise on the large, mostly frozen island.

Read More