After months of wandering, President Clinton and his political team this week suddenly found themselves treading on familiar terrain. He is heading into battle armed with polls suggesting the public is on his side, against an adversary he has bested before: House Speaker Newt Gingrich (R-Ga.).

With six weeks to go before congressional elections that many advisers believe could determine his survival in office, Clinton still has plenty to worry about. But the gloom that has hung over the White House this year, and which reached its bleakest point a week or so ago, has lifted.

There are two main reasons for rising optimism on the Clinton team. What threatened to be a Democratic stampede away from the president on Capitol Hill has halted, with many lawmakers now favoring some sort of official rebuke short of impeachment. The other change is that the showdown over Clinton's future has shifted from a legal realm, where Clinton's misleading testimony in the Paula Jones lawsuit left him vulnerable, to a political realm where Clinton has usually prospered  especially when up against an opposition party with vulnerabilities of its own. In short, the battle has moved from the grand jury room to the War Room.

"There's a lot more hope that he can really win this thing," said former White House chief of staff Leon E. Panetta, describing the mood of his former colleagues. "This is no longer about waiting for the lawyers. This is now a game taking place in an arena they understand, which is the political arena, where they are much more comfortable with the conversation."

Panetta is himself evidence of how the ground has shifted. For months he was critical of Clinton for failing to come clean with the public about his sexual follies with Monica S. Lewinsky, and for misleading the country about them. Now back on board, he even participates in a daily conference call the White House holds with supportive lawyers, lobbyists, political consultants and former administration officials.

Clinton and first lady Hillary Rodham Clinton are active participants in a barely hidden campaign to build momentum for a punishment  such as a congressional censure and financial penalty  that would leave the president in office. He has called Democratic lawmakers to let them know he is open to the censure option, administration and congressional officials said. And Hillary Clinton has also joined the effort to corral Democratic support, calling Democrats who have been critical, such as Rep. James P. Moran Jr. (Va.).

Both spoke out publicly yesterday, suggesting that Republicans  rather than the false comments the president made for seven months about his affair with Lewinsky  who are responsible for a controversy that polls show the public wants ended.

At a Rose Garden ceremony called to tout favorable trends in income and poverty levels, Clinton was asked if he sees "any way out of an impeachment inquiry."

"Well, let me answer you this way: The right thing to do is for us all to focus on what's best for the American people," he said. "And the right thing for me to do is what I'm doing. I'm working on leading our country, and I'm working on healing my family."

Then he went on to recite his agenda, including increased education spending and saving the budget surplus until long-term changes are made in Social Security. "The way out here  and the only way out is for people in Washington to do what the folks in America want them to do, which is to take care of their concerns, their children and their future," Clinton said.

Hillary Clinton was in Colorado to appear at Democratic fund-raisers and to promote the administration's proposal to hire 100,000 additional public school teachers. Speaking of Republicans, she said through a steely smile: "They'd rather spend their time dividing our country, diverting our resources, doing anything but focusing on the real problems of America."

The White House's principal goal, for now, is to unite Democrats behind a censure option. The prospects of Congress passing a censure resolution in the near term have faded; Gingrich on Wednesday rejected an immediate compromise, saying "it was putting the cart before the horse." But that stance itself energized Clinton supporters. Ever since the budget battles of 1995 and 1996, disdain for Gingrich has proven to be one force capable of overcoming the mutual suspicion between the White House and House Democrats.

With no deal on punishment for Clinton imminent, the strategy for Democrats is to tell the public that it is Gingrich and conservative Republicans who are responsible for prolonging the Lewinsky matter. A new poll by the Pew Research Center showed 70 percent of the people want Clinton to remain in office (44 percent favor a reprimand, 26 percent favor doing nothing). Only 26 percent favor removing him from office.

House Democratic leader Richard A. Gephardt (Mo.) is again an ally. He has encouraged efforts by Democrats to build support for a censure alternative in advance of a planned vote early next month on authorizing an impeachment inquiry.

And support in other important quarters is building for this option. A coalition of women's organizations told reporters yesterday that despite their repulsion at Clinton's behavior, they oppose impeachment or resignation and will campaign against politicians who focus more on the sex scandal than on issues they care about. The groups included the National Organization for Women, the Feminist Majority, and the National Abortion and Reproductive Rights Action League.

"As feminist leaders, we will not stand idly by while a Congress made up of nearly 90 percent men attempts to remove the first president elected by women voters," the coalition said in a statement. "I want women to be respected and treated equally," said the coalition's president, the Feminist Majority's Eleanor Smeal. "But even I cannot look at this misconduct and label it a 'high' crime."

The Democratic National Committee is planning a resolution of support for Clinton before it ends a meeting here Saturday. At the White House, officials who had been badly dispirited about Clinton's behavior and his prospects for survival have begun to warm to the fight. "We're in a congressional process now  albeit an unusual one  that is more familiar territory for us," said Paul Begala.

The Clinton team also believes that there are no more surprises for Clinton after this week's airing of his grand jury testimony. "The line held," said adviser James Carville. "You can feel it in the polls, you can feel it in the coverage  things are starting to come back."

The new optimism could be short-lived. A senior congressional Democratic aide said Clinton will face Democratic defections and renewed momentum for impeachment if the party sustains major losses in the Nov. 3 elections.

And Republicans say the public will never hold the GOP accountable for a scandal that is self-evidently Clinton's responsibility. "They are a few fries short of a Happy Meal if they think they're going to pin this on Newt Gingrich," said Christina Martin, spokeswoman for the speaker.