(CNN) -- When dinosaurs roamed the Earth 90 million years ago, the planet was much warmer, including Antarctica at the South Pole. But in a surprising twist, researchers have discovered evidence that Antarctica also supported a swampy rainforest at the time, according to a new study.

Researchers captured a slice of the seafloor using a drill rig aboard a polar research vessel on West Antarctica's Amundsen Sea between February and March in 2017. The sediment core sample was taken near the Pine Island and Thwaites glaciers.

CT scans of the sediment core revealed pristine samples of forest soil, pollen, spores and even root systems so well preserved that they could identify cell structures. The soil included examples of pollen from the first flowering plants found this close to the South Pole.

They dated the soil, its fine-grained clay and silt to 90 million years ago. Their study published Wednesday in the journal Nature.

"During the initial shipboard assessments, the unusual coloration of the sediment layer quickly caught our attention; it clearly differed from the layers above it," said Johann Klages, study author and geologist at the Alfred Wegener Institute. "We had found a layer originally formed on land, not in the ocean."

Scientists know that during the age of the dinosaurs, conditions were warmer. The mid-Cretaceous era, from 80 million to 115 million years ago, was the warmest period for Earth in the past 140 million years, the researchers said. The surface of the sea likely reached 95 degrees Fahrenheit in tropical areas. And the sea level was 558 feet higher than it is now.

But there has been no evidence about what conditions were like at the South Pole. This is the southermost sample of the Cretaceous period collected so far, revealing what Antarctica was like between 83 and 93 million years ago.

"The preservation of this 90-million-year-old forest is exceptional, but even more surprising is the world it reveals," said Tina van de Flierdt, study co-author and professor in the Imperial College London's Department of Earth Science and Engineering. "Even during months of darkness, swampy temperate rainforests were able to grow close to the South Pole, revealing an even warmer climate than we expected."

Sediment cores can record a lot of information about climate, acting like a time capsule for average temperature, rainfall and vegetation.

"To get a better idea of what the climate was like in this warmest phase of the Cretaceous, we first assessed the climatic conditions under which the plants' modern descendants live," Klages said.

The findings paint an unusual portrait of the South Pole, where West Antarctica's coast was free of the ice caps that cover it now and swampy rainforests covered the area instead.

The average daytime temperature was 53 degrees Fahrenheit. While that sounds mild to us, this is incredibly warm for a location near the South Pole, where current daytime temperatures hover between negative 76 degrees to 14 degrees Fahrenheit. And, as the researchers point out, it's only two degrees warmer than Germany at the moment in March.

The Antarctic ice sheet didn't exist at the time. River and swamp temperatures were likely around 68 degrees Fahrenheit. And the Antarctic summer temperature was likely around 66 degrees Fahrenheit. They estimate rainfall reached about 97 inches per year -- about the same as Wales today.

The forests were similar to those now found on New Zealand's South Island, the researchers said.

But how did Antarctica sustain temperate rainforests without year-round sunlight? Even millions of years ago, the South Pole endured what's known as a four-month polar night when no sunlight can be seen.

The researchers investigated the levels of carbon dioxide that would have been in the atmosphere at the time.

They found atmospheric carbon dioxide was much higher than expected based on existing climate models. Carbon dioxide has a warming effect on the atmosphere and the planet, creating a greenhouse effect by trapping heat from the sun.

The high amount of carbon dioxide, combined with an ice sheet-less Antarctica covered in vegetation created the right conditions for a rainforest environment.

"We now know that there could easily be four straight months without sunlight in the Cretaceous. But because the carbon dioxide concentration was so high, the climate around the South Pole was nevertheless temperate, without ice masses," said Torsten Bickert, study co-author and geoscientist at the University of Bremen's MARUM research center.

But the scientists still don't know what caused Antarctica to cool off enough to form ice sheets, which leads them to their next challenge.

The story was first published on CNN.com "Evidence of ancient rainforests found in Antarctica"