Built in the 16th century and formerly the Old Customs House ( Alfandega Velha ) , the oldest parts of this building lie inside the imposing gateway .
The building was built in the 18th century and the oldest part of the building lies outside the gateway .