A list of university firsts: pulling an all-nighter, battling a horrendous hangover, converting to a diet of pizza and pop alone. Students in one small town in Spain can now also add palatial living to the record: Cartagena-based studio Martin Lejarraga Oficina de Arquitectura has converted two 19th-century palaces into a nearly 3,000-sq-m modern university dormitory in Granada.

It may seem like Europe, a cultural landscape so rich in history, has no shortage of architectural monuments. Yet many of these heritage buildings run the risk of falling into disrepair – not every community has the right demographics willing to fill religious institutions, grand villas or remote castles. As published in a 2016 article for Smithsonian Magazine, Europa Nostra, founders of the 7 Most Endangered Programme (that’s endangered buildings, for the record), cite funding cuts and lack of preservation expertise as additional reasons buildings may be neglected. Converting a palace into student residences is one way to keep heritage buildings relevant and maintained.

Faced with such specific spatial typologies – the palaces’ saloons, chapels and double- and triple-height patios – Martin Lejarraga Oficina ultimately prioritized their preservation, rather than choosing to sacrifice these unique spaces in the process of reconfiguration. None of the dormitories are quite like the other, each sporting their own spatial idiosyncrasies – in all, the dormitories can sleep between one and four students.

The two palaces are connected via a glazed floor-to-ceiling addition. Toggling preservation with retrofit, the designers recovered the exterior patios and garden but updated the lighting and furnishings. Lejarraga’s furniture – playful, contemporary and above all colourful – adds a touch of whimsy against the historic interior.