The main building of the University of Porto, in the historic center, is currently home to the Rectory and two museums: the Museum of Natural History and the Science Museum, both established in 1996. Built and remodelled over more than one century, it housed the Royal Academy of Maritime and Trade Affairs (1803-1837) and the Polytechnic Academy of Porto, its successor (1837-1911). The space belonged to the College of Orphaned Children, which remained there until mid-19th century. The College building resembled a convent, with four wings around a cloister, with the Church of Nossa Senhora da Graça on the northern side.
The first architectural design of the Royal Academy of Maritime and Trade Affairs of Porto was done by the architect and teacher from Lisbon José da Costa e Silva (1747-1819), and was later reviewed by Carlos Luís Ferreira de Amarante (1748-1815), a self-taught architect, bridge engineer, designer, graphic designer and illustrator.
The construction of the Academy was funded by the City Council of Porto, the General Company of Alto Douro Viticulture, and a tax known as "do real de vinho" or "literary tariff". The slow pace of construction was due to the economic and political instability in the country, but also to the need to adapt the facilities to the various features of the building.
During the second half of the 19th century, the works were in charge of an engineering teacher Gustavo Adolfo Gonçalves de Sousa (1818-1899) and engineer António Ferreira de Araújo e Silva (…).
In 1911, with the establishment of the University of Porto, the Polytechnic Academy was split and integrated, in part, in the Faculty of Sciences. The building in the current Praça de Gomes Teixeira, called, at the time Praça dos Voluntários da Rainha [The Queen’s Volunteers Square], housed the Rectory, the Faculty of Sciences, with its museums and laboratories, and an Engineering College, linked to the Faculty.
On 20 April 1974, a devastating fire destroyed part of the building, then occupied by the Faculty of Sciences, the Faculty of Economics and the Rectory of the University. The fire and the water used to put it out caused extensive damage to the roof, floors, archives, decoration and furniture. Major intervention works were done to the building’s structure and distribution of spaces, particularly in its northern part. An additional floor was added, as well as new staircases, lifts and toilets, among others.
In 1976, the Rectory had to move to the building of the former Driving School of Porto, in Rua de D. Manuel II, to return only in 2006.