Most of the known history of Tanganyika before 1964 concerns the coastal area, although the interior has a number of important prehistoric sites, including the Olduvai Gorge. Trading contacts between Arabia and the East African coast existed by the 1st century AD, and there are indications of connections with India. The coastal trading centres were mainly Arab settlements, and relations between the Arabs and their African neighbours appear to have been fairly friendly. After the arrival of the Portuguese in the late 15th century, the position of the Arabs was gradually undermined, but the Portuguese made little attempt to penetrate into the interior. They lost their foothold north of the Ruvuma River early in the 18th century as a result of an alliance between the coastal Arabs and the ruler of Muscat on the Arabian Peninsula. This link remained extremely tenuous, however, until French interest in the slave trade from the ancient town of Kilwa, on the Tanganyikan coast, revived the trade in 1776. Attention by the French also aroused the sultan of Muscat's interest in the economic possibilities of the East African coast, and a new Omani governor was appointed at Kilwa. For some time most of the slaves came from the Kilwa hinterland, and until the 19th century such contacts as existed between the coast and the interior were due mainly to African caravans from the interior.
In their constant search for slaves, Arab traders began to penetrate farther into the interior, more particularly in the southeast toward Lake Nyasa. Farther north two merchants from India followed the tribal trade routes to reach the country of the Nyamwezi about 1825. Along this route ivory appears to have been as great an attraction as slaves, and Sa'id bin Sultan himself, after the transfer of his capital from Muscat to Zanzibar, gave every encouragement to the Arabs to pursue these trading possibilities. From the Nyamwezi country the Arabs pressed on to Lake Tanganyika in the early 1840s. Tabora (or Kazé, as it was then called) and Ujiji, on Lake Tanganyika, became important trading centres, and a number of Arabs made their homes there. They did not annex these territories but occasionally ejected hostile chieftains. Mirambo, an African chief who built for himself a temporary empire to the west of Tabora in the 1860s and '70s, effectively blocked the Arab trade routes when they refused to pay him tribute. His empire was purely a personal one, however, and collapsed on his death in 1884.
The first Europeans to show an interest in Tanganyika in the 19th century were missionaries of the Church Missionary Society, Johann Ludwig Krapf and Johannes Rebmann, who in the late 1840s reached Kilimanjaro. It was a fellow missionary, Jakob Erhardt, whose famous "slug" map (showing, on Arab information, a vast, shapeless, inland lake) helped stimulate the interest of the British explorers Richard Burton and John Hanning Speke. They traveled from Bagamoyo to Lake Tanganyika in 1857-58, and Speke also saw Lake Victoria. This expedition was followed by Speke's second journey, in 1860, in the company of J.A. Grant, to justify the former's claim that the Nile rose in Lake Victoria. These primarily geographic explorations were followed by the activities of David Livingstone, who in 1866 set out on his last journey for Lake Nyasa. Livingstone's object was to expose the horrors of the slave trade and, by opening up legitimate trade with the interior, to destroy the slave trade at its roots. Livingstone's journey led to the later expeditions of H.M. Stanley and V.L. Cameron. Spurred on by Livingstone's work and example, a number of missionary societies began to take an interest in East Africa after 1860.