Worry in Congress about the course of U.S. strategy in Iraq boiled over yesterday into a scalding attack on Defense Secretary Donald H. Rumsfeld and some of the toughest questioning of the Pentagon leader since the war in Iraq began.

During a day of contentious hearings in the Senate and House, Rumsfeld disputed assertions that the U.S. campaign is faltering and argued that the conflict there remains worth its costs in lives and dollars. He also rejected the idea, backed by a small bipartisan group of lawmakers, of setting a timetable for withdrawing U.S. troops, although he said he favors pressing Iraqi authorities to keep to their timetable this year for a new constitution and national elections.

"Any who say we have lost or are losing are flat wrong," he declared in an opening statement, appealing for perseverance. "We are not."

The defense chief's defiant stance was echoed by visiting Iraqi Prime Minister Ibrahim Jafari, who is to meet with President Bush today. Setting a specific date for U.S. withdrawal "would be walking into the enemy," he said in a Blair House interview with Washington Post reporters and editors.

But lawmakers in both parties, citing continued violence in Iraq and uncertainty about when the conflict will end, expressed growing misgiving about open-ended U.S. involvement. The harshest criticism came in the Senate.

In the day's most dramatic confrontation, Sen. Edward M. Kennedy (D-Mass.), a leading critic of the Iraq campaign, told Rumsfeld that the war has become a "seeming intractable quagmire." He recited a long list of what he called "gross errors and mistakes" in the U.S. military campaign and concluded with a renewed appeal for Rumsfeld to step down.

"In baseball, it's three strikes, you're out," Kennedy said before a standing-room-only session of the Armed Services Committee. "What is it for the secretary of defense? Isn't it time for you to resign?"

Rumsfeld paused, appearing to collect his thoughts and composure.

"Well, that is quite a statement," he responded, adding that none of the three four-star generals seated with him "agrees with you that we're in a quagmire and that there's no end in sight." Indeed, each of the officers -- Army Gen. John P. Abizaid, commander of U.S. forces in the Persian Gulf; Gen. George Casey, the top U.S. commander in Iraq; and Gen. Richard B. Myers, chairman of the Joint Chiefs of Staff -- then affirmed as much.

Rumsfeld also noted that he had offered to resign twice and that President Bush decided not to accept the offers -- a reference to a period in the spring of 2004 when evidence of detainee abuse at the Abu Ghraib prison outside Baghdad became public.

But Republicans as well as Democrats joined in calling Rumsfeld's attention to signs of declining public support for U.S. involvement in Iraq.

"I'm here to tell you, sir, in the most patriotic state that I can imagine, people are beginning to question," said Lindsey O. Graham (R-S.C.). "And I don't think it's a blip on the radar screen. I think we have a chronic problem on our hands."

Sen. Joseph I. Lieberman (D-Conn.) warned, "I fear that American public opinion is tipping away from this effort."

If there is such tipping among Americans, Rumsfeld allowed, "I have a feeling they're getting pushed" -- an apparent reference to unfavorable news coverage and political commentary. Rumsfeld expressed confidence that support would rebound.

Abizaid, in turn, voiced concern that U.S. troops are becoming aware of the drop in public support and are asking him "whether or not they've got support from the American people."

Abizaid noted that while confidence among U.S. forces in the field "has never been higher," the political mood in Washington appears strikingly different. "I've never seen the lack of confidence greater," he said.

But Abizaid also offered an assessment of the Iraqi insurgency that contrasted with more optimistic portrayals by some administration officials. He said that the resistance remains about as strong as it was six months ago and acknowledged the possibility that enemy fighters still have sufficient reserves to mount "a military surprise" such as a surge in coordinated attacks.

His remarks appeared at odds with a claim last week by Vice President Cheney -- reaffirmed yesterday in an interview with CNN -- that the insurgency is in its "last throes." Pressed on the seeming difference, Abizaid said, "I'm sure you'll forgive me" for not criticizing the vice president.

Still, he, Rumsfeld and the other military authorities attempted to present a picture of considerable progress in Iraq across not only military but also political and economic fronts. They said that despite a rise in enemy attacks since earlier this year, the number remains at about the same level as a year ago and at only about half of previous peaks. They said Iraqi security forces are becoming more capable, and Iraqi opinion polls showed more confidence in the forces and in the interim government. Additionally, Iraqi political authorities remain on track to draft a new constitution and elect a new national government by the end of the year, they said.

There appeared to be little support on either the Senate or House armed services committees for setting a timetable to withdraw U.S. troops. But Carl M. Levin (D-Mich.), the senior minority member on the Senate side, said that giving Iraqis "an open-ended commitment" on U.S. forces also was unacceptable.

Arguing that something needs to be done to "change the current dynamic in Iraq," Levin suggested added pressure on Iraqi authorities to keep to their schedule for a new constitution and national elections by warning them that failure would cause the United States "to rethink our presence there."

Rumsfeld agreed with the need for staying on schedule, saying he opposed even invoking the six-month extension allowed under existing Iraqi law. Any delay, he added, "would retard the entire process." But he stopped short of endorsing the idea of threatening repercussions if the schedule should slip.

Throughout the Post interview, Jafari did not sound like a leader who thought U.S. troops were close to coming home. He said three conditions must be met to snuff out the insurgency.

"First of all, the borders must be made very, very secure," he said. "Secondly, Iraqi security forces must be of a caliber to carry out widespread and effective offensives against terrorists, and, thirdly, the judiciary must be activated so that justice" can be carried out. He counseled Americans to remember what happened to Germany after it was ignored by the United States and others after World War I, giving rise to Nazism. "Let's go back and take lessons from history," Jafari said.

Staff writer Jim VandeHei contributed to this report.

Defense Secretary Donald Rumsfeld said he thinks that opinion about the war is being swayed and that support for U.S. efforts will rebound.