The history of the school is diverse and complex. The building that currently hosts the school was built in the Middle Ages as the Hospital of Saint Celso. Later, in 1758 it became the Cistercian monastery of Saint Luke and was used as a military hospital first and then, at the hands of Pietro Teulié, as a military orphanage. With the advent of the Napoleonic Italian Kingdom, the orphanage's name was changed to "Royal College of the Military Orphans". In 1839 the Austrian Emperor Ferdinand I, converted the orphanage to the "Imperial college of cadets". In 1848 the cadets took part in the Five Days of Milan, after which the building hosted the "Royal school of artillery".