Future engineers in the Lego Club at Newburgh Primary School took on much older youngsters when they and their teachers entered a national competition held at Loughborough University.
The nine and ten-year-olds won a trophy for their research topic and third prize in a robotics challenge.
Over the past three months the youngsters designed, made and programmed three robots to take to the competition before competing in an unseen test.
Newburgh head teacher Andrew Smith said: “What a fantastic achievement and well done to everyone involved.
“I am immensely proud of all the children and adults who have worked so hard. To compete against much older students and be successful is a real credit to the children and the staff who have worked tirelessly with them.”