A Brazilian general told a hearing this week that gay soldiers should not be allowed to command troops because they would be disobeyed by other officers.

Gen Raymundo Nonato was appearing before a senate commission considering his appointment to head Brazil’s top military court on Wednesday.

He said that gay soldiers would not be sacked if they kept their sexual orientation secret, a gay soldier “will not be obeyed by his subordinates in combat situations”.

The US is currently considering lifting the ban on gays and lesbians serving openly in the military. Brazil’s military allows gays and lesbians to be open about their sexuality.

Gen Nonato was asked for his views on gays by the commission, which unanimously approved his selection.

Gay rights groups attacked the decision and Brazilian Bar Association, a lawyers’ association said that discrimination was still a problem.

Bar association president Ophir Cavalcante told Associated Press: “It’s sad that this type of discrimination still exists in the armed forces.

“The defence of the country must be performed by men and women who are prepared and trained, independently of each person’s sexual orientation.”