The first Customs House in Porto was built shortly after 1325, in the reign of D. Afonso IV (1325-1357). Trade, especially maritime trade, is one of the features defining the city’s configuration, its wealth and its prosperity. With the rise of a rich merchant class, enriched by the appropriation of assets belonging to the clergy (1834), and the increase in foreign trade, particularly that of Port Wine, in the 19th century, new roads were laid out to facilitate the rising level of traffic, and the riverside quay was remodeled and extended with the construction of the New Customs House (1861), on an embankment of Miragaia beach.