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 justcompleted 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.