Ghana's President John Atta Mills has rejected the UK's threat to cut aid if he refuses to legalise homosexuality.
Mr Atta Mills said the UK could not impose its values on Ghana and he would never legalise homosexuality.
UK Prime Minister David Cameron said at the weekend that aid would be cut to countries which failed to respect gay rights.
Uganda also rejected the threat, with an official accusing the UK of showing a "bullying mentality".
Most Africans argue that homosexuality violates their religious and cultural beliefs.
Mr Atta Mills said Mr Cameron was entitled to his views, but he did not have the right to "direct to other sovereign nations as to what they should do".
He said Ghana's "societal norms" were different from those in the UK.
"I, as president, will never initiate or support any attempt to legalise homosexuality in Ghana," Mr Atta Mills said.
On Monday, Ugandan presidential adviser John Nagenda said Mr Cameron was showing a "bullying mentality" and Ugandans would not tolerate being treated like "children".
"If they must take their money, so be it," Mr Nagenda said.
Mr Cameron said he had raised the issue of gay rights at last week's Commonwealth Heads of Government Meeting in Perth, Australia.
Ending the bans on homosexuality was one of the recommendations of an internal report into the future relevance of the Commonwealth.
Mr Cameron's threat applies only to one type of bilateral aid known as general budget support, and would not reduce the overall amount of aid to any one country, correspondents say.
Ghana received bilateral aid from the UK of about £90m ($144m) during the last financial year, of which about £36m was as general budget support.
Mr Atta Mills' communications chief Koku Anyidoho told the BBC the government would not compromise its morals for money.
"If that aid is going to be tied to things that will destroy the moral fibre of society, do you really want that?" he told the BBC's Focus on Africa programme.
Mr Cameron said he had spoken with "a number of African countries" and that more pressure had been applied by UK Foreign Secretary William Hague, who deputised for him during parts of the Commonwealth summit.
Some 41 nations within the 54-member Commonwealth have laws banning homosexual acts.
Many of these laws are a legacy of British colonial rule, correspondents say.