If not, Mr. Gates predicted fights in the courts and the possibility that the repeal would be “imposed immediately by judicial fiat.”

In a survey of 115,000 active-duty and reserve service members, the report found distinct differences among the branches of the military, particularly in the Marine Corps, whose leaders have been the most publicly opposed to allowing gay and bisexual men and women to serve openly. While 30 percent of those surveyed over all predicted that repeal would have some negative effects, 40 percent to 60 percent of the Marine Corps and those in various combat specialties said it would be negative.

Mr. Johnson and General Ham, who briefed reporters on the report, did not offer a specific explanation for why Marines were more opposed to repeal, although General Ham said that among Marine Corps respondents, a lower percentage had served alongside someone they believed to be gay or lesbian. This summer, when the Marine commandant at the time, Gen. James T. Conway, was asked for an explanation about Marine resistance to repeal, he responded that it was difficult to answer, but “we recruit a certain type of young American, a pretty macho guy or gal.”

In his remarks to reporters on Tuesday, Mr. Gates acknowledged the higher levels of “discomfort” about repealing the law among those in the combat branches of the military. He said that those findings remained a concern to him as well as to the chiefs of the service branches, but that the concerns were not insurmountable as long as any repeal was carried out carefully and with what he said was “sufficient time and preparation to get the job done right.”

Mr. Gates refused to offer a timetable for how long that might be, and neither Mr. Johnson nor General Ham would say whether the process could take months or years. As the bill before the Senate now stands, any repeal would not be carried out until President Obama, Mr. Gates and Adm. Mike Mullen, the chairman of the Joint Chiefs of Staff, certified that the military was ready to end the ban.