Rebecca went to see the pupils as part of her tour to promote the new swimming centre in Batley and provide every child in school with a free swimming session.
Talking to all the pupils in what was described as an "inspirational assembly", she promoted the importance of water safety in and around the local area, while sharing her passion for swimming.
When the opportunity came for the four-time Olympic medallist to visit the school, teachers jumped at the chance, sharing clips of her winning races during the Beijing and London Olympic Games.
Rebecca brought some of her Olympic medals and gave several children the chance to hold and admire them, also providing pupils with an autographed picture.
The children were full of enthusiasm for her visit and had prepared plenty of questions to ask, which she happily answered.
Fiona Gardiner, head teacher at Thornhill Junior and Infant School, said: “The children and staff were really excited to meet Rebecca and she exceeded our expectations.
“We really hope as a school that as many children as possible will take Rebecca up at the chance of a free swimming session and feel inspired to work as hard towards their goals as she spoke about.”