Health Minister Ummy Mwalimu justified the move on the grounds that the product encourages homosexuality, which is banned in the east African nation.
“It is true that the government has banned the importation and use of the jelly to curb the spread of HIV,” the minister told local media on Tuesday.
“It is estimated that 23 percent of men who have sex with men in Tanzania are living with HIV/AIDS,” he added.
“I have instructed stakeholders working with gay people to remove the products from the market.”
Groups working with the gay community were handing out the lube for free, the minister said.
“The ministry has agreed to work with stakeholders to give the ministry the money they were using to buy and import the lubricants so we could use it to buy beds for the maternity wards.”
Gay male sex is punishable by life imprisonment under Tanzanian law, but there is no such ban on lesbian relations.
In practice, there had been no known arrests over homosexuality in recent years.
But the newly appointed regional commissioner for the port city of Dar es Salaam, Paul Makonda, announced a major crackdown against gay people this month, followed by arrests of suspected gays in clubs.
Some people who have been openly gay on the internet stopped posting after Makonda threatened that police would arrest those who follow them on social media.