President Yoweri Museveni of Uganda has put harsh anti-gay legislation on hold while he seeks advice from American scientists on whether homosexuality is caused by nature or nurture.

The controversial bill, which has attracted worldwide condemnation, had been due to become law, making Uganda the latest African country to clamp down on gay and lesbian people, but Museveni's intervention reflects the agonised debate now taking place between Africa and the west.

A week ago Museveni had insisted that he would approve the legislation, prompting criticism from US president Barack Obama and former president Bill Clinton. The US warned that the move would "complicate" relations with Uganda, to which it gives more than $400m (£240m) in aid annually.

Uganda dismissed the threat as blackmail but on Friday it emerged that Museveni had done a u-turn and would not sign the proposed law until after hearing from scientists. "I therefore encourage the US government to help us by working with our scientists to study whether, indeed, there are people who are born homosexual," he wrote. "When that is proved, we can review this legislation."

But he added: "Africans do not seek to impose their views on anybody. We do not want anybody to impose their views on us. This very debate was provoked by western groups who come to our schools and try to recruit children into homosexuality."

Homosexuality is already illegal in Uganda under the colonial-era penal code. The new legislation extends the existing penalty of life imprisonment for same-sex intercourse to other same-sex behaviour, including the mere touching of another person with the intent to have sexual relations. Conducting a marriage ceremony for same-sex couples or failing to report gay people to the authorities would be punishable by prison.

Tamale Mirundi, a presidential spokesman, told Reuters that the bill would be on hold "until more conclusive research is done, and that's what the president is saying in that letter".

Museveni's repeated changes of heart come as he tries to placate conservative politicians, church leaders, media and the public, all of whom express deep hostility to homosexuality, while not alienating western aid donors who demand that human rights be respected. It is a tension being played out across Africa, where homosexuality is illegal in 36 countries.

Museveni, an evangelical Christian, last month said he would shelve the bill, but last weekend told MPs from his ruling National Resistance Movement that he planned to sign it after receiving a report from a group of Ugandan scientists.

Among conclusions of the report, seen by the Observer, are: "There is no definitive gene responsible for homosexuality; homosexuality is not a disease; homosexuality is not an abnormality; In every society, there is a small number of people with homosexual tendencies; Homosexuality can be influenced by environmental factors."

Simon Lokodo,Uganda's ethics and integrity minister, suggested the nature versus nurture debate was already closed. "It is a social style of life that is acquired," he said. "The point is they chose to be homosexual and are trying to recruit others. The commercialisation of homosexuality is unacceptable. If they were doing it in their own rooms we wouldn't mind, but when they go for children, that's not fair. They are beasts of the forest."

Lokodo condemned western meddling in Uganda's domestic affairs. "When I heard the US saying they will cut aid, we said fine. Will they be comfortable if we come to America and started practising polygamy? Homosexuality is strange to us and polygamy is strange to you. We have divergent views. When they call me wrong, I will call them wrong. Don't bring it to Africa; keep it there."

More than 25,000 people in the UK have written to Museveni via Amnesty International's website, urging him to veto the bill. Gemma Houldey, Amnesty's Uganda researcher, said: "This deeply offensive piece of legislation is an affront to the human rights of all Ugandans and should never have got this far."