Citing the results of a Pentagon survey of 115,000 active duty and reserve service members, Mr. McCain, Republican of Arizona, said that 58 percent of Marines in combat units and 48 percent of Army combat troops thought repealing the 17-year-old law would have either a negative or a very negative impact on the ability of their units to work together.

?I remain concerned, as I have in the past, and as demonstrated in this study, that the closer we get to service members in combat, the more we encounter concerns about whether ?don?t ask, don?t tell? should be repealed,? Mr. McCain said at a Senate hearing. ?These views should not be considered lightly, especially considering how much combat our forces face.?

Mr. McCain?s views were in striking contrast to those expressed by an array of the nation?s top defense and military officials, who appeared before the Senate Armed Services Committee to urge repeal of the law, which requires gay men and women in the military to keep their sexual orientation secret or face discharge. The officials also pressed on the committee the larger conclusions of the survey, which found that 70 percent of all service members responded that allowing gay men and women to serve openly in the military ?would be positive, mixed or of no consequence at all.?.

At one point, Mr. McCain sharply asked Defense Secretary Robert M. Gates, whose testimony led off the Pentagon?s position, if he was not concerned that so many combat forces were concerned about repeal of the law. Mr. Gates replied that many of those in combat are in their early 20s, have also never served with women and have a focused, limited experience in the military.

?With time and adequate preparation, we can mitigate their concerns,? Mr. Gates said.

?I couldn?t disagree more,? Mr. McCain shot back. ?We send these young people into combat, we think they?re mature enough to fight and die. I think they?re mature enough to make a judgment on who they want to serve with and the impact on their battle effectiveness.? Mr. McCain, a naval aviator in the Vietnam War who was shot down and imprisoned in Hanoi, then added: ?Mr. Secretary, I speak from personal experience.?

Adm. Mike Mullen, the chairman of the Joint Chiefs of Staff, appeared alongside Mr. Gates and made a personal appeal to the panel. ?I?ve been serving with gays and lesbians my whole career,? he said. ?I went to war with them aboard a destroyer off the coast of Vietnam. I knew they were there. They knew I knew it. We never missed a mission, never failed to deliver ordnance on target.?

Admiral Mullen added: ?Should repeal occur, some soldiers and Marines may want separate shower facilities. Some may ask for different berthing. Some may even quit the service. We?ll deal with that.?

Repeal faces uncertain prospects in the Senate. It is unclear if there are enough Republicans willing to vote for it, and also if there is enough time in the lame-duck Senate before the end of the year.

Both Mr. Gates and Admiral Mullen made the argument to the committee that the Senate should vote in the next few weeks because delaying would result in a wave of lawsuits and the potential for repeal to be ordered by what Mr. Gates called "judicial fiat? -- meaning, he said, that the military would have no time to prepare for the change. "Those that choose not to act legislatively are rolling the dice that this policy will not be abruptly overturned by the courts,? Mr. Gates said.

Mr. Gates and Admiral Mullen also spoke against the argument of "not now," voiced by many of the surveyed combat troops, that a time of two wars was not the right moment to impose social change on the force. Admiral Mullen told the committee that he had no expectation that "challenges to our national security are going to diminish in the near future, such that a more convenient time will appear.?

Mr. Gates said: "If not now, when? When we?re out of Afghanistan? But who?s to say, as I look ahead in the world, I don?t see the world getting to be a safer, easier place to live in, where our troops are necessarily under less stress.?

The two appeared to be heading off the arguments that are also expected to be advanced in testimony before the panel on Friday by the chiefs of the Army, Air Force and Navy, and the commandant of the Marine Corps. All have expressed reluctance about repeal.

Mr. Gates and Mr. Mullen appeared with the co-authors of a just-released Pentagon report on the effects of repeal on the military: Jeh C. Johnson, the Pentagon?s general counsel, and Gen. Carter Ham, the commander of the U.S. Army in Europe.

The defense and military officials were frequently pressed by Republicans whether it was a good idea to push for repeal when the survey revealed so much resistance among the surveyed combat forces. Mr. Gates at one point bristled at those questions and said that although the military?s opinions were important, it did not get a vote.

"I can?t think of a single precedent in American history of doing a referendum of the American armed forces on a policy issue,? Mr. Gates told the panel. "Are you going to ask them if they want 15-month tours? Are you going to ask them if they want to be part of the surge in Iraq? That?s not the way our civilian-led military has ever worked in our entire history. The ?should? question is to be decided by the Congress.?

When Senator Roger Wicker, Republican of Mississippi, kept pushing the issue, Mr. Gates responded, "I think that in effect doing a referendum of the armed forces on a policy matter is a very dangerous path.?