In agreement with the UN, England granted to Tanganyika initially internal autonomy on May 1, 1961 and subsequently full independence in December 9, 1961.
 
Tanganyika, that entered the Commonwealth as a monarchy linked to the British crown, opted, on December 9, 1962, for the republican form of government with Julius Kambarage Nyerere as its first president.
 
On December 1963, also Zanzibar and Pemba gained independence and in April 1964 were integrated to Tanganyika as a result of an agreement between the two presidents, Nyerere and Abeid Karume, who thus became respectively President and Vice President of the United Republic of Tanzania.
 
On  October 1, 1964, it was promulgated the Interim Constitution of the United Republic of Tanzania, completed by an annex that reproduced the Statute of TANU, as the only party that defined the base of Tanzanian socialism and that found its programmatic formulation in the declaration of Arusha in 1967.
 
In the seventies of the twentieth century the contrasts between Tanzania, Uganda and Kenya caused the dissolution of the East African Community (1977), that had been the common economic and political base of these countries.
 
The contrasts later worsened between Tanzania and Uganda, erupting in a real conflict in 1978 and 1979, that ended with the defeat of Uganda by Tanzanian forces.
 
In 1985, Julius Nyerere resigned from the presidency of the Republic, after to have been in office for 24 years, but remained at the head of the Chama Cha Mapinduzi, CCM or Revolutionary Party, the only party that was born in 1977 from the merge of TANU and ASP, the Afro-Shirazi Party, operating in Zanzibar.
 
The new head of state, Ali Hassan Mwinyi, responsive promoter of economic liberalization measures and a restructuring plan, was harshly criticized by Nyerere who, after being re-elected in 1987 at the head of CCM with a five-year term, in 1990 resigned.
 
The political and economic transition in the liberal sense, initiated in 1985, ended with the reunification of the two charges, the presidency of the Republic and the presidency of the party in the hands of A.H. Mwinyi, who in 1990 won the presidential elections and led his supporters to the state institutions summits.
 
The beginning of the nineties saw the extension of the liberalization of the economic plan, including the political one, sanctioned by the formal recognition of the multi-party system by the Extraordinary Conference of the CCM in February 1992, as well engaging in an internal democratization effort.
 
This did not lead, however, to new elections: the opposition remained divided and could not organize themselves into a coalition that included the active movements in the islands of Pemba and Zanzibar, where they continued to manifest separatist tendencies.
 
To mitigate the autonomists turmoil the National Assembly in 1993 passed a resolution that also extended to Tanganyika the broad autonomy already planned for Zanzibar.
 
In November 1994, CCM won a landslide victory in the first multi-party elections: President A. H. Mwinyi appointed as prime minister Cleopas Msuya, receiving the affirmative vote of the National Assembly.
 
On October 1995, he finally held the first multiparty presidential and legislative elections, but for this the opposition immediately demanded the cancellation, denouncing electoral fraud and irregularities in favor of government candidates.
 
At the presidency of the republic was nevertheless elected Benjamin Mkapa belonging to the CCM; CCM also managed to win the absolute majority of seats in the National Assembly, while much less net result was his victory in the elections of the Chambers Representatives held simultaneously in Zanzibar: this provoked the widespread protests of the leaders of the CUF opposition party, the United Civic Front.
 
In November of the same year, President B. Mkapa could form a new government, entrusting the post of Prime Minister to Frederick Sumaye.
 
The CCM reaffirmed itself in the 2000 elections, that confirmed again B. Mkapa to the presidency; in Zanzibar, however, the elections were canceled for serious irregularities; a demonstration organized by the CUF declared illegal by the CCM took place on the island in 2001 to demand the repetition of elections and caused violent clashes with around 200 dead and many injured.
 
In order to put an end to political violence CCM and CUF signed an agreement by negotiating a long-term solution to the crisis.
 
As well, in 2001 Tanzania signed an agreement with Malawi to resolve a long dispute for the border on the Songwe River and at International level, in March 2004, the Tanzanian government signed a preliminary agreement with Kenya and Uganda for the creation of a customs union.
 
In 2005, legislative elections were held again: B. Mkapa had already served two terms and constitutionally could not be re-elected, so as CCM candidate, ran for elections the Foreign Minister, Jakaya Kikwete who, with 80% of votes, was appointed president.
 
The CCM then kept controlling by an overwhelming majority the country's political life while ensuring respect for democratic rules.
 
In October 2010, the incumbent president won the presidential election with more than 60% of the votes; while on November 5, 2015 he was elected President John Magufuli again part of the CCM.