The history of the Gold Coast before the last quarter of the 15th century is derived primarily from oral tradition that refers to migrations from the ancient kingdoms of the western Soudan (the area of Mauritania and Mali). The Gold Coast was renamed Ghana upon independence in 1957 because of indications that present-day inhabitants descended from migrants who moved south from the ancient kingdom of Ghana. The first contact between Europe and the Gold Coast dates from 1470, when a party of Portuguese landed. In 1482, the Portuguese built Elmina Castle as a permanent trading base. Thomas Windham made the first recorded English trading voyage to the coast in 1553. During the next three centuries, the English, Danes, Dutch, Germans, and Portuguese controlled various parts of the coastal areas.
In 1821, the British Government took control of the British trading forts on the Gold Coast. In 1844, Fanti chiefs in the area signed an agreement with the British that became the legal steppingstone to colonial status for the coastal area.
From 1826 to 1900, the British fought a series of campaigns against the Ashantis, whose kingdom was located inland. In 1902, they succeeded in establishing firm control over the Ashanti region and making the northern territories a protectorate. British Togoland, the fourth territorial element eventually to form the nation, was part of a former German colony administered by the United Kingdom from Accra as a League of Nations mandate after 1922. In December 1946, British Togoland became a UN Trust Territory, and in 1957, following a 1956 plebiscite, the United Nations agreed that the territory would become part of Ghana when the Gold Coast achieved independence.