House Minority Whip Steny Hoyer (Md.), right, and other House Democrats listen as President Obama speaks at the House Democratic Issues Conference in Lansdowne, Va., on Feb. 7. (Charles Dharapak/AP)

The settings for their annual retreats couldn’t have been more similar: House Democrats and House Republicans decamped to separate private golf resorts in Virginia that provided ample privacy for days of reflection and planning. But the groups’ mood and outlook couldn’t have been more different.

Democrats, who met this week at the Lansdowne Resort outside Leesburg, emerged from their meetings convinced that even though they have the least political leverage of any political group in Congress, the national conversation is shifting in their direction.

On economic issues, gun control and immigration, they see growing national support and agreement with the nation’s most popular elected official, President Obama, who told them Thursday that he and they will be “joined at the hip” as they work to achieve his legislative goals.

“This is very upbeat,” said Rep. Sander M. Levin (D-Mich.), describing the mood at the Democratic retreat. “The election results very much energized us.”

A GOP retreat held two weeks ago at the Kingsmill Resort in Williamsburg was more introspective as Republicans conducted a somber assessment of their November election losses.

Democrats, meanwhile, celebrated their successes with speeches from the party’s biggest stars — Obama, Vice President Biden and former president Bill Clinton — and a visit from comedian Stephen Colbert.

On Friday, Clinton advised Democrats to embrace the policies that have given the party its new edge, including the 2010 federal health-care law, and not to ease up on efforts to pass new laws on guns and immigration.

But he said Democrats must be careful not to alienate voters looking for a middle ground.

“You cannot assume that people that you look at and say, ‘Oh now, that’s not my demographic,’ that they have nothing to say to you,” Clinton said.

Clinton’s remarks were a note of caution in an otherwise fairly triumphant three-day gathering.

Democrats note that Republicans have given way on taxes, long their guiding star. The GOP reluctantly went along with a proposal to conclude the “fiscal cliff” drama which allowed income taxes to increase on couples making more than $450,000 a year.

An immigration overhaul, once thought virtually impossible in the face of an implacable Republican House majority, now seems like a clear possibility.

And after the Newtown, Conn., school massacre, a long-dormant discussion of gun control has dominated the national news for weeks.

“To the degree that the Democratic caucus is included and some of our views are addressed in legislation, it’s good for the nation,” said Rep. Ed Perlmutter (D-Colo.).

The other reason for House Democrats’ high spirits? An understanding that the Republican majority needs them. House Speaker John A. Boehner (R-Ohio) has time and again relied on the votes of Democrats to help move must-pass legislation when a bloc of 50 or more of his own conservative members has refused to go along.

Without Democrats, the fiscal-cliff bill would not have been adopted. Nor would a bill to provide billions in aid to victims of Hurricane Sandy that had threatened to become a massive public-relations problem for the national Republican Party. When Democrats refused to go along with Boehner’s proposed solution to the fiscal cliff in December — which would have allowed taxes to increase only on income over $1 million a year — the plan collapsed in an embarrassing failure because of Boehner’s inability to get a majority of 218 votes from his own members.

Even a measure adopted last month to suspend the nation’s debt ceiling for three months — an idea advanced by Republican leaders and which enjoyed broad support within the party — still drew 33 Republican “no” votes and would have fallen short without Democratic support.

“There’s broadening recognition that without us, nothing’s going to get passed,” said Rep. Gerald E. Connolly (D-Va.). “That flies in the face of conventional wisdom about minorities in the House.”

“No one should be taking House Democrats for granted,” said Rep. Chris Van Hollen (D-Md.), “because House Democrats do hold the balance on many of these important votes.”

But how often Boehner will allow legislation to move to the floor for adoption without his most conservative votes is an open question. So far, he has mostly reserved the maneuver for fiscal deadlines in which Congress had to act or risk sinking the economy. He may be less likely to do so in cases such as immigration and gun control, domestic policy priorities of the White House that lack looming deadlines.

Still, Democrats say the election created a new kind of deadline for the GOP — an electoral imperative. On immigration in particular, Republican leaders have indicated the need for a shift in order to avoid alienating the nation’s growing population of Hispanic voters. With many of the conservative rank and file still opposed, that creates an opening for a new coalition to form on the issue.