Fossils of an ancient "toothy" dolphin were discovered in a Peru desert, helping to shed light on today's unusual river dolphin species, according to new research.

The Pisco Basin, a desert that stretches along the coast of southern Peru, may have been covered in miles of water some 16 million years ago, home to a now-extinct family of dolphins known as squalodelphinids.

The new findings, published in the Journal of Vertebrate Paleontology, include the fossils of three dolphins, two of which have well-preserved skulls. Skeletal analysis suggests that the fossils are not only of a new species, but are also related to today's endangered South Asian river dolphins living in the Indus and Ganges rivers.

"The quality of the fossils places these specimens as some of the best-preserved members of this rare family," lead author Olivier Lambert, of the Institut Royal des Sciences Naturelles de Belgique, said in a statement.

River dolphins are considered unusual mammals in that they choose to reside in muddy freshwater rivers and estuaries even though their ancestors swam in the salty oceans. As a result of swimming off the beaten path, some of these dolphins have long, toothy beaks, are functionally blind, and have very small dorsal fins. These dolphins are not to be confused with the similar-looking, though distantly related river dolphins of the Amazon and Yangtze rivers.

Due to their bizarre behavior, scientists have had a tough time placing river dolphins in the family tree.

"It's not normal for a whale or a dolphin to live in freshwater these days," Jonathan Geisler, an associate professor of anatomy at the New York Institute of Technology, who was not involved in the study, told Live Science. "What seems to have happened is they've independently adapted to living in freshwater conditions."

The new species, named Huaridelphis raimondii and from the Miocene epoch, help to solve this puzzle, at least for the South Asian river dolphin.

"It's helping flesh out this pretty poorly known extinct family that helps tie this oddball living species into the evolutionary tree," Geisler said.