<Tr> <Td_colspan="2"> Location of Elmina Castle </Td> </Tr> <Tr> <Td_colspan="2"> (edit on Wikidata) </Td> </Tr> <P> Elmina Castle was erected by the Portuguese in 1482 as São Jorge da Mina (St. George of the Mine) Castle, also known simply as Mina or Feitoria da Mina) in present - day Elmina, Ghana (formerly the Gold Coast). It was the first trading post built on the Gulf of Guinea, so is the oldest European building in existence south of the Sahara . First established as a trade settlement, the castle later became one of the most important stops on the route of the Atlantic slave trade . The Dutch seized the fort from the Portuguese in 1637, and took over all the Portuguese Gold Coast in 1642 . The slave trade continued under the Dutch until 1814; in 1872, the Dutch Gold Coast, including the fort, became a possession of the British Empire . </P> <P> Britain granted the Gold Coast its independence in 1957, and control of the castle was transferred to the nation formed out of the colony, present - day Ghana . Today Elmina Castle is a popular historical site, and was a major filming location for Werner Herzog's 1987 drama film Cobra Verde . The castle is recognized by UNESCO as a World Heritage Site . </P>

What was the purpose of the elmina castle