The ancient remains of a horned beast uncovered by fossil hunters in Montana belong to the last known dinosaur to walk the Earth and give weight to the theory that the creatures were wiped out by an asteroid.

A brow horn of the creature was found in sedimentary rock deposited shortly before the mass extinction 65.5 million years ago.

Other dinosaur fossils are either much older, or were unearthed after being washed from their original graves into much younger sediments, long after they died.

The discovery adds to growing evidence that the dinosaurs were wiped out when a comet or asteroid crashed into Earth at the end of the cretaceous.

The animal, most likely an adult triceratops, was not the last dinosaur standing, but the last survivor of their impressive reign to be identified by palaeontologists. Adult triceratops grew to around 9 metres long and weighed up to 12 tonnes.

Researchers spotted the 45cm horn while hunting for fossils in the Hell Creek Formation, a 100m-thick slab of mudstone in south eastern Montana. The region is one of the few in the world that preserves fossils before and after the period of the mass extinction.

"This is the youngest dinosaur that has been discovered in situ. Others can be found in younger deposits, but those have been put there by geological processes and are actually much older," said Tyler Lyson, a palaeontologist at Yale University.

The discovery undermines a theory that gained ground in the 1980s, which claims that land-dwelling dinosaurs died out long before an asteroid slammed into the planet to produce what is known as the Chicxulub crater on the Yucatan peninsula in Mexico. One explanation claims the dinosaurs were killed off by climate change or a change in sea level.

The theory carried some weight until now, because no fossils had been found within three metres of the K-T boundary, the geological line in sedimentary rock that signifies the impact of the asteroid. The latest fossil was discovered a mere 13cm below that line.

"This demonstrates that dinosaurs did not go extinct prior to the impact and that at least some dinosaurs were doing very well right up until we had the impact," Lyson told the Guardian. The study appears in the journal Biology letters.

On spotting the dinosaur horn, the researchers dug a trench next door to the fossil and removed rock samples from various depths. These were sent to Antoine Bercovici at the China University of Geosciences, who analysed pollen grains in the rocks to identify the K-T boundary. When the asteroid hit, the existing plant life died out, and was later replaced with a growth of ferns.

While the impact at Chicxulub is largely uncontested, the manner in which it killed the dinosaurs is still open to debate. "The impact may have kicked up dust and blocked out the sun and caused a nuclear winter that killed off the plant life.

"Another idea is that the collision produced a thermal pulse, a microwaving effect of the entire Earth, so anything that was out on the surface, that couldn't burrow in the ground, or go underwater, was fried," Lyson said.