Television footage showed a wild boar charging around a classroom, bashing its snout against a window in an apparent attempt to escape the school in the western city of Kyoto.
Meanwhile, the other boar was taking a soothing dip in the school's outdoor pool, as stunned pupils looked on.
"I was very surprised to see it," a male pupil told Nippon TV, adding that they moved at "super" speed.
Students were taking mid-term exams when Monday's unwelcome interruption occurred but the exams eventually continued as scheduled, public broadcaster NHK reported.
Wild boars have increasingly been sighted in cities near Japan's mountainous countryside, as observers say over-development has deprived them of their habitat. Click for more trending news
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.