The imposing modern structures that make up the main university – mostly built in the 1940s and 50s – give little hint of the riches hidden away behind the white facades of the broad Paço das Escolas square. Accessed via the seventeenth-century Porta Férrea (the “iron gate” that once stood here), the Velha Universidade is housed in the former royal palaces. You’ll need to buy a ticket to look round it, though you’re free to enjoy the city views from the terrace to one side of the square.

Biblioteca Joanina and the Academic Prison

Highlight of the Velha Universidade is the Biblioteca Joanina, a Baroque confection of cleverly-marbled wood, gold leaf, imposing frescoed ceilings and elaborate trompe-l’oeil decorations. The ancient library was installed in 1717 by Dom João V, whose portrait surveys his legacy from the library walls, which are lined with some 250,000 books dating back to the twelfth century. At busy times, you’ll be ushered on from the library after a few minutes to the so-called Academic Prison in the basement below. This proved that studying was no laughing matter: the windowless cell was used until 1832 to punish badly behaved students.

Capela de São Miguel and Sala dos Capelos

After leaving the library, glance into the adjacent Capela de São Miguel, a sixteenth-century chapel with a splendid eighteenth-century Baroque organ, then head up the grand double stairway from the central square to the Sala dos Capelos. This series of grand rooms was once part of the royal palace and then became an ornate venue for students to sit their exams, beneath the portraits of former monarchs and university rectors. The rooms are still used to award degree certificates: previous graduates include epic poet Luís de Camões, writer Eça de QueirÓs and twentieth-century dictator Salazar. Don’t miss the narrow balcony outside that gives grand views across the town.

The clock tower

Those with a head for heights can climb the somewhat claustrophobic spiral stairs to the top of the eighteenth-century clock tower for spectacular views over the entire area. The tower is nicknamed cabra (the goat), an unaffectionate term lamenting its role in summoning students to lessons.