After seven years quiet study, S. Thomas was forced to take refuge with his family from the violence of the imperial soldiers, who had sacked the abbey, and made a prey of all its wealth in plate and gems, the legacies of emperors, kings, and knights. The change to the feudal castle of Loreto must have been a violent one for the young saint. The tramp of armed men, the free carousing, the shouts and songs of mirth, must have been sources of temptation to a boy of twelve, whose life had hitherto been passed in the silence of the cloister, or amid the sacred songs of the monks, but the holy impressions already made on his soul shielded it from corruption.
An anecdote is related of him at this period which shows how full his young heart was of charity. During his sojourn at Loreto, a terrible famine ravaged Southern Italy. The Aquinos were extremely charitable to the poor, and Thomas acted as his father's almoner. But not satisfied with this, he sometimes stole secretly into the kitchen, filled his cloak with whatever came to hand, and hurried to the castle gate to divide his spoils amongst the famishing people. Having been reprimanded for doing so, he still persisted; but one day, as he was carrying his cloak full of provisions, he met his father unexpectedly, and was commanded to show what he was hiding with so much care. The child let fall his burden, but in the place of bread, a shower of flowers hid the feet of the boy, and the old man, Landulf, burst into tears, and, embracing his son, bade him follow at liberty the inspirations of his charity.
His parents determined to send S. Thomas to the University of Naples, which was then at the height of its prosperity. Tasti states that he commenced the study of theology under the profound Erasmus, the Benedictine professor of that science in the University. Tocco states, however, that the abbot of Monte Cassino advised his removal from Monte Cassino, and his being placed at the University of Naples, where he studied grammar and logic under Martin, and natural science under Peter de Hibernia.
It was the custom for the students, after the professor had delivered his lecture, to present themselves at a stated time, and deliver what they had heard before their companions in the schools. When it came to S. Thomas's turn, he repeated the lectures with greater depth of thought, and greater lucidity of method, than the learned professor himself was able to command.