Reprising policy battles that Republicans and Democrats have contested for decades, President Bush and challenger John F. Kerry sharpened their differences on social and domestic issues last night, with each candidate comfortably articulating the positions his most loyal supporters wanted to hear.

In the last of their three debates, Bush avoided the slumps and the scowls that marred his first test against Kerry -- heeding what he said was an order from his wife -- and found many occasions to categorize the senator from Massachusetts as a classic big-spending liberal.

But Kerry, as unruffled as he has been throughout his confrontations with the president, did nothing to damage his prospects. Neutral observers, including some who gave Bush a narrow edge, predicted Kerry would maintain the momentum that has brought him from an underdog's position at the start of September to rough parity with the incumbent.

The debate, held at Arizona State University, was less antagonistic in tone than the earlier meetings, but the relative absence of personal barbs served only to highlight the scale of the policy differences between the two.

It sets the stage for a final sprint to Election Day in less than three weeks, with Bush now well aware of the seriousness of his second-term challenge and Kerry bolstered by the fact that he stood toe to toe with the president for 41/2 hours without flinching.

After an opening question that allowed both men to reprise the dispute over Iraq and terrorism, which dominated the first two debates, moderator Bob Schieffer of CBS News moved rapidly through an encyclopedia of domestic issues -- jobs, education, health care and Social Security among them -- and into social issues that produced sharper partisan contrasts than in the other two debates.

Throughout the confrontation, Bush was alert to opportunities to label Kerry as a reckless spender of taxpayer dollars -- or, as he put it once, a politician who dwells on "the left bank of the mainstream" along with his Massachusetts colleague, Sen. Edward M. Kennedy.

Meanwhile, Kerry rarely passed up a chance to depict Bush as someone with a shaky grasp on reality -- whether it was the fragile conditions in Iraq or the pressures working-class families are feeling in this economy -- and to tee up his argument for change.

The contrasting political agendas were underlined by the amused but skeptical expressions on the faces of both men when the other one was making his argument. They were apparent in the way both candidates chose to handle difficult questions.

Kerry, a Roman Catholic, said he respected but disagreed with the bishops of his church who have counseled the faithful to deny him votes because of his support of abortion rights and embryonic stem cell research. Bush identified himself with the position taken by the Catholic hierarchy -- and by the important bloc of voters who look to the church for guidance.

When Schieffer raised the question of gay marriage in a novel form -- asking whether the rivals believe that homosexuality is a choice -- Bush said he did not know but attempted to reconcile his support for a constitutional amendment banning same-sex marriage with his belief that "consenting adults can live the way they want to live."

Kerry said he believes sexual orientation is a given and the proposed amendment is unnecessary and unwise. But his awkward reference to the lesbian daughter of Vice President Cheney was quickly condemned by Lynne Cheney as "a cheap and tawdry political trick."

When Kerry, and later Schieffer, pressed Bush to say whether he wanted to see Roe v. Wade, the basic abortion rights decision, overturned, Bush simply repeated his line that he favored "a culture of life" but would have no "litmus test" for any Supreme Court appointee. Kerry underlined the omission by saying that while "the president wants to leave it ambivalent . . . I believe the right of choice is a constitutional right" that should be defended by anyone aspiring to the high court.

On the familiar ground of education, health care and jobs, neither candidate strayed far from the rhetoric he has been using for months. There may have been a slightly more populist tone to Kerry's depiction of Bush as a man who had sacrificed domestic welfare to an insatiable desire to cut taxes for the wealthiest Americans. And Bush may have unearthed more of the lines from his 2000 "compassionate conservative" repertory than he has been using in his guise as the commander in chief of the war on terrorism.

But both candidates were playing to their strengths in terms of public opinion. In the latest Washington Post tracking poll, including the last three nights before the debate, Kerry had a three-percentage-point lead over Bush on the economy and education, a five-point lead on jobs, and a 12-point advantage on health care.

But the same sample of likely voters, asked to describe their own political philosophy, split 2 to 1 conservative over liberal, with almost half saying "moderate." Bush knew he was on safe ground going after liberals, because fewer than one out of five likely voters chooses the label.

Kerry, by the same calculus, knew that many government programs are widely popular, even if the label attached to those who support them is not.

One awkward moment for Bush came when Schieffer asked if the minimum wage is due for an increase. Kerry jumped on the issue, saying that it is the lowest in purchasing power it has been in 50 years and promising to "fight tooth and nail" to raise it. Bush mumbled a line about supporting a GOP alternative and then switched the subject to education, offering it as the long-term solution to the problems of employment and wages.

The final debate came at a critical moment in the campaign. Kerry put himself back into the race by his strong performance at the first debate on Sept. 30 in Coral Gables, Fla. Bush's performance last Friday, when they met for the second time in St. Louis, was more aggressive and focused, but post-debate polls continued to show Kerry making gains. For all practical purposes, the contest going into this final debate was a tossup.

The personal tension between the rivals melted at the end, when Schieffer closed with a softball question about the "strong women" Bush and Kerry had married.

That is when Bush allowed that first lady Laura Bush had given him an order to "stand up straight and not scowl."

But Kerry got the bigger laugh when he described Bush and himself as "lucky people who married up" and then added, in an obvious reference to his wealthy heiress wife, Teresa Heinz Kerry: "Maybe me more so than others."

It was a rare moment of levity in what has been a campaign mostly lacking in laughs. And it provided an equally rare occasion for Kerry to drop his policy-wonk persona and show, even only briefly, a lighter touch.