Up to 12 feet (3.7 meters) in length and with a fierce, aggressive attitude, two new species of giant dwarf crocodile that have just been identified by scientists are not ones you would have wanted to encounter during the Early and Middle Miocene.

These beasts would have roamed parts of Africa between 15 and 18 million years ago. It looks as though they then abruptly disappeared from the scene – a sudden exit that may have been the result of swift environmental changes.

The two new species have been named Kinyang mabokoensis and Kinyang tchernovi, and while they bear some resemblance to the dwarf crocodiles of today, these creatures would have been as much as four times larger.

"These were the biggest predators our ancestors faced," says paleontologist Christopher Brochu from the University of Iowa.

"They were opportunistic predators, just as crocodiles are today. It would have been downright perilous for ancient humans to head down to the river for a drink."

The animals had snouts that were short and deep, the researchers report, with teeth that were large and conical. Unlike the crocodiles of today, which have nostrils facing directly up, the nostrils of K. mabokoensis and K. tchernovi would have faced more to the front.

The discovery of the two new species was made through an analysis of multiple skull fragments collected from digs in the East Africa Rift Valley, which researchers describe as revealing a "very similar" but still distinct pair of crocodile species.

These creatures would have spent most of the time in the forest looking for prey, rather than in the water. At the time, the regions where they most probably lived and died (in parts of what is now Kenya) would have been covered with vast forests.

A gradual retreat of the forests due to climate change and reduced rainfall is the most likely explanation for the species vanishing, the researchers suggest. Forests gave way to grasslands and mixed savanna woodlands that the animals were less suited to.

"Modern dwarf crocodiles are found exclusively in forested wetlands," says Brochu. "Loss of habitat may have prompted a major change in the crocodiles found in the area."

"These same environmental changes have been linked to the rise of the larger bipedal primates that gave rise to modern humans."

This hypothesis is going to require further research because it's not fully clear when exactly the Kinyang crocodiles became extinct. There's a gap in the fossil record between these giant dwarf crocodiles and modern species that would be useful to fill in.

There's also more to discover about these species in particular – researchers aren't exactly sure how many teeth they would've had, for example. Now that the species have been identified, other fossils can be matched to them in the future.

"They had what looked like this big grin that made them look really happy, but they would bite your face off if you gave them the chance," says Brochu.

The research has been published in The Anatomical Record.