WASHINGTON - Just more than a year ago, a chastened President Bush acknowledged that his party had taken a "thumping" in the congressional elections, and he greeted the new Democratic majority at the weakest point of his presidency.
But since then, Democrats in Congress have taken a thumping of their own as Bush has curbed their budget demands, blocked a cherished children's health initiative, stalled the drive to withdraw troops from Iraq, and stymied efforts to raise taxes.
Rather than turn tail for his last two years in the White House, Bush has used every remaining weapon in his depleted arsenal - the veto, executive orders, the loyalty of Republicans in Congress - to keep Democrats from getting their way.
He has struck a combative pose, dashing hopes he would be more accommodating after his party's drubbing in the 2006 midterm voting.
Bush's own second-term domestic agenda is a shambles: His ambitions to overhaul Social Security and immigration law are dead; plans to update his signature education program have foundered; few other initiatives are waiting in the wings.
But on a host of foreign and domestic policy issues, backed by a remarkably disciplined Republican Party in Congress, Bush has been able to confound Democrats.
It has been a source of great frustration to the party that came to power with sky-high expectations and the belief it had a mandate for change, and a vivid reminder of how much clout even a weakened president can have - especially if he is as single-minded as Bush.
"We have custody of Congress, but we don't have control," Rep. Howard L. Berman (D., Calif.) said. "Bush has shown, time and again, that he's a very stubborn guy."
Yesterday, Senate Majority Leader Harry Reid said congressional Democrats accomplished important goals this year but they need more cooperation from Republicans. Bush and his GOP allies in Congress thwarted them while siding with tobacco firms and "big oil companies," said Reid (D., Nev.).
Many Republicans have been surprised and impressed with Bush's continuing power - even when he has used it to ends they disagreed with.
"At the beginning of the year, most of us viewed the president as having less control over the process than ever," said Rep. Michael N. Castle (R., Del.), a moderate who voted against Bush on health, budget and other issues. "But this year, he realized more goals than in a lot of the years when he had Republicans controlling Congress."
On Thursday, after Congress adjourned for the year, Bush had kind words for much of Congress' work and did not gloat over his success in keeping Democrats' ambitions in check.
Democrats blamed Bush for this year's congressional gridlock, but his inflexibility on key issues was just one factor.
Republican lawmakers showed little interest in compromise. Democrats were riven by internal divisions. And Bush did little to unite rather than divide the factions on Capitol Hill.
Immediately after the 2006 elections, it looked as if Bush might offer Democrats an olive branch and set a more bipartisan tone. He fired his controversial defense secretary, Donald H. Rumsfeld. He called incoming House Speaker Nancy Pelosi (D., Calif.) at home on Christmas. After years of ignoring congressional Democrats, he began inviting them to the White House to hear them out.
But the honeymoon did not last long. Democrats were furious when, after an election they believed was a mandate to withdraw U.S. troops from Iraq, Bush in January announced a buildup.
A few weeks later, he went around Congress and issued an executive order giving the White House greater control over the rules and policies issued by regulatory agencies. White House meetings with Democrats turned partisan - and then petered out. Veto threats started flying.
His first veto this year stopped a war spending bill that included a timetable for withdrawing from Iraq. Democrats' promise to press the issue all year lost steam after testimony in September from the top commander in Iraq, Army Gen. David H. Petraeus, instilled confidence in Republicans whose commitment to the war had grown shaky.
Without more GOP defections, Democrats in the Senate were powerless to undercut Bush's war policy.
Bush also wielded his veto power to great effect on domestic issues.
He blocked Democratic efforts to expand stem-cell research - a popular bill that enjoyed broad bipartisan support. The failed override effort provided a window onto a dynamic that was key to Bush's source of strength throughout the year: Many moderate Republicans parted ways with him on the stem-cell override vote, as they later did on his veto of the children's health bill, but enough conservatives agreed with him to sustain his vetoes.
Bush issued a barrage of veto threats to curb Democrats' domestic spending plans - an effort that helped him regain some favor among fiscal conservatives who had lambasted him for allowing the Republican-controlled Congress to jack up spending to record levels.
Bush also held the line against Democrats' efforts to raise taxes, which they proposed to offset the costs of new health spending, energy programs and a middle-class tax break.
Heading into the 2008 elections, Democrats will have to keep their supporters from becoming demoralized over not being able to deliver more with their majority.
"It's hard for them to understand," said Senate Majority Whip Richard J. Durbin (D., Ill.), "and it's even harder for us to live with."