The vote on Sunday was for 16,000 seats for street and village leaders, positions that are highly influential in Tanzanian life.
The long-ruling Chama Cha Mapinduzi (CCM) party of President John Magufuli swept the poll as expected in the East African country.
To continue to participate in elections of this kind is to legitimise illegality.
Chadema, the main opposition party, said earlier this month it would not be taking part because its candidates were too afraid or had been disqualified by stringent rules.
Five other smaller parties also joined the boycott.
“In most cases, CCM candidates were unopposed,” the minister for regional administration and local government, Selemen Jaffo, told a press conference in Dodoma.
In a very small number of cases, opposition candidates did win because they had not officially withdrawn their bid, he said.
Significance of local elections
Local leaders wield considerable power in Tanzania. For example, elderly people need to have an endorsement from their local chief to be able to have access to free medical care.
In the previous local ballot in 2014, the CMM won three-quarters of the 12,000 seats that were being contested that year. Chadema picked up 15 percent.
Chadema say their activists have been kidnapped and beaten, and at least one has blamed authorities for an attack in 2017 in which he was shot multiple times.
Several have disappeared and turned up murdered.
“Our party believes it is wiser not to support such electoral cheating,” Chadema president Freeman Mbowe said in November. “To continue to participate in elections of this kind is to legitimise illegality.”
In the economic capital Dar es Salaam, several polling stations were closed because the CCM candidate stood unopposed and thus was automatically elected.
Four of Tanzania’s 26 mainland regions did not hold polls at all because of the opposition boycott.
Political analysts say the local elections could set the tone for next year, when President John Magufuli, a strongman in power since 2015, is expected to run again.
Magufuli has been fiercely criticised by watchdogs for his human rights record.
Free media has been intimidated by draconian cybercrime laws, critical newspapers and bloggers have been silenced, and opposition activists have been harassed, according to Human Rights Watch (HRW) and Amnesty International.