Tanzania has been spared the internal strife that has blighted many African states.
Domestic stability has not translated into economic prosperity for Tanzanians, however. Many of its people live below the World Bank poverty line, although the country has had some success in wooing donors and investors.
Tanzania is home to two renowned tourism destinations - Africa's highest mountain, Kilimanjaro, and wildlife-rich national parks such as the Serengeti - but has become a target for poachers.
Conservationists have warned that the entire elephant population could die out by the end of the decade if they continue to be killed for their ivory at the current rate.
United Republic of Tanzania
Population 55.5 million
Area 945,087 sq km (364,900 sq miles)
Major languages English, Swahili
Major religions Christianity, Islam
Life expectancy 63 years (men), 67 years (women)
Currency Tanzanian shilling
President: Samia Suluhu Hassan
Vice-President Hassan took over in March 2021 on the death of President John Magufuli.Mr Magufuli had caused international concern over his campaign against the independent media and other issues, including gay rights and his handling of the Covid-19 pandemic. The government said he died of heart problems, although the opposition has alleged his death was Covid-related.
Samia Suhulu Hassan was elected as Mr Magufuli's running mate in 2015 and again in 2020. A contrasting figure to her abrasive and impetuous predecessor, she is due to serve out the remainder of his five-year term.
Television is eroding radio's traditional dominance, and media ownership is highly concentrated.
Under the former president, John Magufuli, there was a significant decline in press freedom.
Laws allow for harsh penalties for content deemed defamatory, seditious or illegal.
Some key dates in Tanzania's history:
1498 - Portuguese explorer Vasco da Gama visits Tanzanian coast. Portugal succeeds in controlling most of the East African coast, until it is ousted from Zanzibar in 1699 by Omani Arabs.
1884 - German Colonisation Society begins to acquire territory, ushering in an era of German control over mainland Tanzania, while Britain enjoys a protectorate over Zanzibar.
1916 - British, Belgian and South African troops occupy German East Africa. Three years later, the League of Nations gives Britain a mandate over Tanganyika - today's mainland Tanzania.
1961 - Tanganyika becomes independent with Julius Nyerere as prime minister; Zanzibar gains independence in 1963.
1964 - Two territories unite as Tanzania.
1978 - Ugandans temporarily occupy a piece of Tanzanian territory and, in 1979, Tanzanian forces invade Uganda, occupying the capital, Kampala, and help to oust President Idi Amin.
1992 - Constitution amended to allow multi-party politics.
1998 - Al-Qaeda Islamist terror group bombs US embassies in Tanzania and Kenya.
2001 - At least 31 people are killed and another 100 arrested in Zanzibar in protests against the government's banning of opposition rallies calling for fresh elections.
Later the same year, tens of thousands of opposition supporters march through the commercial capital, Dar es Salaam, in the first major joint demonstration by opposition parties in decades.
2012 - The Statoil and Exxon Mobil oil exploration companies make major discovery of gas reserves off the coast of Tanzania.