The youngsters threw themselves into the occasion and looked to be having the time of their lives during the annual Raisin Monday celebrations.
The foam fight is the climax to festivities where students are ‘adopted’ by academic parents.
Lathered up: First year students from St Andrews University take part in the tradition foam fight
Get off your soap box: Two friends get into the spirit of things during the festivities at the university in Scotland
Raisin Monday: The celebrations stem from a gift of raisins traditionally given by a first year student to their academic 'parents' in gratitude for their guidance
They are encouraged to drink as much as possible and carry out various forfeits.
The event occurs at the university's St Salvator's Quadrangle, where eggs and flour have been banned for fear of damaging the historic buildings.
The tradition dates back to the early days of the university in Scotland, where Prince William was once a student, where new students would give senior students a pound (0.45kg) of raisins in gratitude for their help in adapting to university life, in exchange for a receipt written in Latin.
Failure to produce such a receipt could result in a dousing in the local fountain. Nowadays the raisins have been replaced with a bottle of wine and the dousing with foam.
Fun in the foam: A group of students lark around during the celebrations today
Wet and wild: The fight is the climax to festivities where students are 'adopted' by academic parents
Covered in foam: The tradition dates back to the early days of the university