WASHINGTON - The moment has been long in coming, but it may finally have arrived.

For the last year and a half, on issues including health care, financial regulation and climate change, Democrats in Congress have bent for President Obama. Liberals swallowed hard to accept compromises that fell short of their long-sought goals, and moderates cast tough votes that now threaten their reelection prospects as voters revolt against perceived government overreach.

Then, last week, the president asked them to bend yet again -- this time to approve more money for his troop buildup in an Afghanistan war that many Democrats oppose.

And once again, lawmakers went to work. On the eve of the vote, Democratic leaders compiled a complicated $82 billion package of war funding, disaster aid and domestic spending that achieved the seemingly impossible -- meeting the president's request while accommodating the needs of its politically diverse members.

Obama responded with a one-word message that sent shudders through his party on the Hill: veto.

In that exchange, the tension between the White House and the president's Democratic allies spilled over.

No flowers or chocolates

Obama has led what historians have called the most productive Congress since President Lyndon Johnson, but he may have a much harder time extracting difficult compromises in the future.

"You've got a lot of people doing a lot of heavy lifting here," said freshman Rep. Gerald Connolly, D-Va. "I don't know that we expected flowers and chocolates," he said. But the president's response "was an unwelcome message."

In recent weeks, the president has expressed growing interest in the remaining items on his legislative agenda, including energy and immigration policy. Both are initiatives whose only hope at passage would require another legislative squeeze from the lawmakers who have already yielded to some of the president's toughest requests.

Yet compromise appears difficult as lawmakers approach the midterm election when they, not the president, must fight for their political lives in a tough electoral climate.

Perhaps no issue so clearly illustrates the divide between the president and his party as the troop increase in the Afghanistan war, an escalated military campaign that many Democrats opposed. Liberals fought President George W. Bush on the war in Iraq. Some Democrats won their seats in the 2006 and 2008 elections doing so. But while many Democrats believe Afghanistan is the right war to fight, Obama's decision to add 30,000 more troops last winter gave pause to the worried.

Because of deepening economic distress at home combined with political and military setbacks in Afghanistan, some Democrats see the war as one without end and one they cannot philosophically or economically support.

"I would rather do a little bit more nation-building here at home," said Rep. Jim McGovern, D-Mass.

A complicated arrangement

Pragmatic liberal lawmakers, for their part, wanted to use the emergency spending bill as a way to win approval for recession aid that would be difficult to pass otherwise as voters grow increasingly concerned about the national debt.

Rep. David Obey, D-Wis., the flinty antiwar lawmaker and powerful chairman of the House Appropriations Committee, devised a complicated legislative strategy that appeased liberal lawmakers by allowing antiwar amendments and pleased moderates by paying for the $10 billion teachers' initiative without adding to the national debt.

"There is nothing as expensive as ignorance, and ignorance is fed when you have an inadequate number of quality teachers," Obey argued during the floor debate.

But the White House was not pleased with the arrangement, threatening late last week to veto the package if it contained any antiwar provisions or cut programs favored by Obama to pay for the teachers' salaries.

The antiwar provisions failed -- though one measure to halt the troop buildup won 100 votes. But the House pressed forward to save the teachers' jobs even in the face of the White House's objections.

The bill now heads to the Senate, and House Democrats were furious at an administration that many see as tone deaf to lawmakers' political realities in a November electoral climate that is not expected to be friendly to incumbents.

"The White House needs to be more engaged with the House's agenda," said Rep. Steve Cohen, an antiwar Democrat from Tennessee. "The House is where its friends are."