The World Bank has withdrawn a $300m (£232m) loan to Tanzania amid concerns about the nation’s policy of expelling pregnant girls from school.

The money, a significant proportion of funding totalling $500m awarded to Tanzania by the bank in 2018, was scheduled for approval last month. It was intended to help Tanzania’s education ministry to improve access to secondary education.

In a double blow for the country, the World Bank announcement came on the same day that Denmark, Tanzania’s second biggest donor, said it was withholding $10m (£7.7m) of aid funding due to unease over human rights abuses and “unacceptable homophobic comments” by a government official.

Tanzanian schools routinely expel girls who become pregnant, who are thought to number about 8,000 a year. The practice dates back several decades but has intensified since President John Magufuli took office in 2015. Some schools have imposed compulsory pregnancy tests on girls.

The president went a step further in June, announcing that students would not be allowed to return to school after giving birth.

In January, campaigners condemned the arrest of five pregnant pupils in the Tandahimba district, on the Mozambique border, saying that the men who impregnated them should be arrested instead.

A source within the World Bank told the Guardian that the government’s policy of expelling pregnant girls was among the reasons for the loan withdrawal.

In an official statement, a bank spokesman said: “The World Bank supports policies that encourage girls’ education and make it possible for young girls to study in schools until they reach their full potential. The economic and social returns for girls finishing their education are very high in every society for both current and future generations.

“Working with our partners, the World Bank will continue to advocate girls’ access to education through our dialogue with the Tanzanian government.”

In 2017, a Human Rights Watch report concluded that the discriminatory policy contributed to 1.5 million children being out of school in the country.

The source said other factors in the bank’s decision to withdraw the loan included misgivings over a new law, approved in September, that would make it a crime to question official statistics. Last month, the World Bank said it was “deeply concerned” about the amendment to the statistics law – which would impose a fine, at least three years in jail, or both – on those who questioned the accuracy of government figures.

In addition, the World Bank has suspended all visiting missions to Tanzania, because of “threats, harassment and discrimination against the LGBT community”. Visits would not resume “until we can secure the safety and security of all employees”, the source said.

Ulla Tornaes, Denmark’s minister for development cooperation, expressed similar concerns following the withdrawal of 65m Danish crowns of aid funding.

“I am very worried about the negative development in Tanzania, the latest being the completely unacceptable homophobic statements from a commissioner,” Tornaes wrote on Twitter.

A spokesperson for the minister later confirmed that Tornaes was alluding to remarks made by Paul Makonda, the administrative chief of Dar Es Salaam, who earlier this month ordered people in the city to report anyone suspected of being gay.

Judy Gitau, the regional coordinator for Equality Now Africa, an advocacy group that has been lobbying to have school expulsions lifted, said: “Unfortunately, the taking away of $300m means all children will suffer. However, it is in the government’s hands to right the wrong, to lift the ban and to ensure the money does come in.

“Most of the young girls who get pregnant come from a background of poverty. The implication of the ban is to deny these girls a basic education and relegate them to a cycle of poverty. The system endorses the view that girls are not as worthy as boys.”

Tanzania has one of the highest adolescent pregnancy rates in the world, with widespread sexual violence and girls exchanging sex for school fees, food and shelter, according to the UN.

Last December, Magufuli pardoned two child rapists who raped 10 primary school children, after serving 13 years of their life sentences.