
In 1886 and 1890, Anglo-german agreements , the German govt . took over direct administration of the territory from the German east Africa Company and appointed a Governor with headquarters at Dar es salaam.
Though the German colonial administration brought cash crops, railroads, and roads to Tanganyika, European rule provoked Africa's resistance culminating in the Maji Maji rebellion in 1905-07 which caused 120,000 Africans to die but that was the first sign of nationalism.
The german colonial domination ended after WW I , when under a league of nation's mandate Tanganyika became a territory under British control.
In 1954, a school teacher, Julius K. Nyerere, formed a party -Tanganyika African national Union (TANU) who won legislative council elections in Sep. 1958,feb. 1959, and Dec,1959, following a general election when Nyerere became the Chief minister and in Dec. 1961 they got full Independence under a new constitution. Mr. Nyerere became the president.