Two British university students became gravely ill after overdosing on caffeine in a botched science experiment.

The sports science students, Alex Rossetto and Luke Parkin, were given 100 times the correct amount—enough for 300 cups of coffee—and were sent to the hospital with "life-threatening reactions," a British court heard Wednesday as it examined breaches of health rules.

Both lost more than 20 pounds (9 kilograms) during their hospitalization but recovered. The experiment to measure the impact of caffeine on exercise took place two years ago at Northumbria University, which prosecutor Adam Farrer said has admitted failing "to follow basic health and safety requirements."

An average cup of coffee contains 0.1 grams of caffeine. The dosage mistake was made after a switch from tablets to powder.