Initially, starting in 1562, the Porto Court operated in private homes but, in 1603, the king ordered the construction of a building for that specific purpose, which was built and then collapsed, in 1752. Between 1765 and 1796 it was reconstructed by order of João de Almada e Melo, following the project of Eugénio dos Santos. It housed the city gaol until 1974. Presently, it is open to the public and houses the Centro Português de Fotografia (Portuguese Photography Centre).
The 12 “Martyrs of Freedom” were imprisoned in this building before being hanged and decapitated by Dom Miguel’s tribunal.