In 1511, a Portuguese fleet arrived under the command of Afonso de Albuquerque. His forces attacked and defeated the armies of the Malacca Sultanate. Moving quickly to consolidate his gains, Albuquerque had the fortress built around a natural hill near the sea. Albuquerque believed that Malacca would become an important port linking Portugal to the Spice Route in China. At this time other Portuguese were establishing outposts in such places as Macau, China and Goa, India to create a string of friendly ports for ships heading to Ming China and returning home to Portugal.

The fortress once consisted of long ramparts and four major towers. One was a four-story keep, while the others held an ammunition storage room, the residence of the captain, and an officers' quarters. Most of the village clustered in town houses inside the fortress walls. As Malacca's population expanded it outgrew the original fort and extensions were added around 1586.

The fort changed hands in 1641 when the Dutch drove the Portuguese out of Malacca. The Dutch renovated the gate in 1670, which explains the logo "ANNO 1670" inscribed on the gate's arch. Above the arch is a bas-relief logo of the Dutch East India Company.

The fortress changed hands again in the late 18th century when the Dutch handed it over to the British to prevent it from falling into the hands of Napoleon's expansionist France. The English were wary of maintaining the fortification and ordered its destruction in 1806. The fort was almost totally demolished but for the timely intervention of Sir Stamford Raffles, the founder of modern Singapore, who was sent on sick leave from Penang to Malacca in 1807. It was Captain William Farquhar, tasked with the destruction of the fort and town, who decided to save two of the gateways to the fort,including the Santiago Gate, as well as the Stadthuys, church and jail.

According to wikipedia