This gives new meaning to being "cool."

The most fearsome predator to ever walk the Earth, Tyrannosaurus rex, had something similar to an "air conditioner" in its head, allowing it to stay cool, according to a new study.

The massive dinosaur had two large holes in the roof of its skull (dorsotemporal fenestra) that were filled with muscles to aid jaw movements. But University of Missouri anatomy professor Casey Holliday said that he was intrigued by the unusual feature, causing him to examine it more closely.

To that end, he and a team of researchers used thermal imaging on modern-day alligators at a park in Florida.

NEW 168-MILLION-YEAR-OLD STEGOSAURUS SPECIES UNEARTHED BY SCIENTISTS

“It’s really weird for a muscle to come up from the jaw, make a 90-degree turn, and go along the roof of the skull,” Holliday, the study's lead author, told Fox News in an email. “Yet, we now have a lot of compelling evidence for blood vessels in this area, based on our work with alligators and other reptiles.”

The researchers found that when they are trying to warm up, there are hot spots in the roofs of their skulls, which show a rise in temperature.

"An alligator's body heat depends on its environment," said one of the study's co-authors, Kent Vliet in a statement."Therefore, we noticed when it was cooler and the alligators are trying to warm up, our thermal imaging showed big hot spots in these holes in the roof of their skull, indicating a rise in temperature. Yet, later in the day when it's warmer, the holes appear dark, like they were turned off to keep cool. This is consistent with prior evidence that alligators have a cross-current circulatory system -- or an internal thermostat, so to speak."

Larry Witmer, one of the other co-authors, said that like the T. rex, alligators have holes on the roof of their skulls that are filled with blood vessels.

"Yet, for over 100 years we've been putting muscles into a similar space with dinosaurs," Witmer added. "By using some anatomy and physiology of current animals, we can show that we can overturn those early hypotheses about the anatomy of this part of the T. rex's skull."

The research has been published in The Anatomical Record.

CLICK HERE TO GET THE FOX NEWS APP