Teacher David Crichton was leading a group of pupils playing football at Galashiels Academy when dozens of the invertebrates began plummeting from the sky. The 22 second-year boys had to abandon their lesson
Mr Crichton said the children had just completed their warm-up when they began to hear "soft thudding" on the ground.
The class then looked to the cloudless sky - and saw worms falling on to them.
Mr Chrichton, 26, said he was baffled by the incident, with teachers later finding more worms spread across a tennis court almost 100 yards away.
Mr Crichton said: "We went out to one of our outdoor areas - an all-weather Astroturf pitch.
"We were out playing football and had just done our warm-up and were about to start the next part of the lesson.
"We started hearing this wee thudding noise on the ground.
"There were about 20 worms already on the ground at this point. Then they just kept coming down.
"The kids were laughing but some were covering their heads and others were running for cover for a while.
"The just scattered to get out of the way."
The teacher scooped up handfuls of the worms that had fallen from the sky as proof they had landed on his class.
Mr Crichton said he and his colleagues eventually found about 120 worms after checking the artificial football pitch and tennis courts.
He said the children had not stopped talking about the incident since it happened on Tuesday.
"I spoke with the science department here but none of them had any explanation for it," Mr Crichton said.
"One of them thought maybe it was a freak weather thing.
"But it was such a clear, calm day."
Kenny McKay, headteacher at Galashiels Academy, said: "The event does coincide with a significant change in the weather in recent days and so could be the result of an unusual meteorological event.
"The students and staff of Galashiels Academy are rightly proud of their school for many reasons, including its record in sport and its beautiful environs.
"However, we never thought we'd be famous for such a strange event."
"None of the students were hurt, although they did find the experience quite bizarre.
"None of them will ever forget the day at school when worms fell out of the sky."
Showers of worms falling from the heavens have been reported in the past.
The incident in Galashiels is believed to have been caused by freak weather over a nearby river lifting water and worms and dumping it over the road.
Similar events were recorded in 1872 in Somerville, Massachusetts, in 1877 in Christiana, Norway, and in 1924 in Halmstad, Sweden.
In July 2007 a woman was crossing a road in Louisiana when large clumps of tangled worms dropped from above.