President Donald Trump has vowed not to cut taxes for the wealthy, extolled the virtues of bipartisanship as leading to “some of the greatest legislation ever passed” and then - in a surprise move announced deep into the night - agreed to cut a deal with Democrats saving hundreds of thousands of illegal immigrants from deportation.

That Trump did all of that while declaring himself “a conservative” only heightened the sense of surrealism that has wafted through the nation's capital over the past eight days, as the president has expressed a newfound, if tentative, willingness to work across the aisle - a development that has left many Republicans chagrined and some Democrats cautiously optimistic.

Trump's outreach suggested that an unexpected deal he reached last week with Democrats may not have been an aberration. This week's effort began on Tuesday at a bipartisan White House dinner with senators and proceeded to a gathering of House Democrats and Republicans on Wednesday afternoon.

It was finally capped off Wednesday night by a presidential meal with the nation's two top Democrats, Senate Minority Leader Charles Schumer, New York, and House Minority Leader Nancy Pelosi, California, during which they reached the contours of an immigration deal and discussed Beijing trade issues over a menu of Chinese cuisine.

Calling the dinner “very productive,” Schumer and Pelosi said in a statement late Wednesday that Trump had agreed to “enshrine the protections” of a Barack Obama-era executive order into law “quickly” protecting about 700,000 illegal immigrants who were brought to the United States as children. They would also “work out a package of border security, excluding the wall, that's acceptable to both sides,” the statement said.

In a separate statement, the White House described the gathering as “constructive” and that is focused on immigration, infrastructure and trade.

“Bottom line: There really is a new strategy coming out of the White House,” said Representative Henry Cuellar, a moderate Texas Democrat who had turned down previous White House invites but decided to attend Wednesday's afternoon session. “He meets with the bipartisan senators last night. He meets with us. He meets with Pelosi and Schumer today. There is a new strategy in place.”

Representative Tom Reed, Republican-New York, a Trump supporter who also attended the afternoon gathering, said the President “has seen the theatre up here and learned the lesson: Extremes on both the right and left are problematic to getting his agenda accomplished. You can't run a partisan bill to the finish line, so he knows he has to have his Plan B ready.”

After eight months of pursuing a mostly hard-right, pro-Republican agenda with limited success, Trump is now flirting with fulfilling his campaign promises to govern as a bipartisan dealmaker - including the possibility of legalising thousands of undocumented immigrants after running stridently against the idea as a candidate. Trump could also be signalling the return of a recently bygone era when lawmakers of both parties dining - and working - with the president was hardly abnormal.

But, then, these are not normal times.

“It's up is down and down is up,” said Jim Manley, a Democrat and former longtime Senate aide. “No doubt about it.”

Last Wednesday, Trump shocked and angered Republican leaders by agreeing with Schumer and Pelosi to provide Hurricane Harvey relief while raising the federal borrowing limit and funding the government through December.

Then came Tuesday's bipartisan dinner for senators, which included talk of infrastructure projects and featured three Democrats up for reelection in 2018 in states that Trump carried: Senators Joe Donnelly, Indiana, Heidi Heitkamp, North Dakota, and Joe Manchin III, West Virginia.

After the afternoon meeting, several House Democrats expressed hope that they can work with the President.

“He was very explicit in saying that there would be no tax cut in this package for the wealthy,” said Representative Peter Welch, Democrat-Vermont, referring to a pledge by Trump on Wednesday that would mark a notable departure from his previous proposals. “At one point, he said they may have to pay a little more.”

Still, Trump has done little to reach out to Democrats until the past week and has often openly derided them and Obama. Trump has begun dismantling Obama-era regulations and protections on issues including health care, labour and the environment. Last week, he also rescinded protections for 700,000 young undocumented immigrants brought to the United States as children and known as “dreamers” - the same group he now says he wants to protect.

Even on Wednesday, as the President played host to two bipartisan meetings, Trump and his team continued to equivocate. He expressed support for another Republican healthcare plan - spearheaded by Senators Bill Cassidy, Republican, and Lindsey Graham, Republican-South Carolina - aimed at sharply curtailing Medicaid and other parts of the Affordable Care Act, commonly called Obamacare. In her daily press briefing, White House Press Secretary Sarah Huckabee Sanders argued that Trump is always working on behalf of Republicans.

“The President is the leader of the Republican Party and was elected by Republicans,” Sanders said.“He beat out 16 other candidates to take that mantle on. And certainly I think one of the strongest voices. And so the idea that the Republican Party ideas are not represented in that room is just ridiculous.”

Trump's reasons for engaging with lawmakers beyond the Republican leadership is deeply shaped by his experience on healthcare legislation, which has so far stalled in the Senate after months of fits and starts, according to two people familiar with the issue who have spoken with him recently. Trump remains unhappy with GOP leaders for promising success earlier in the year, only to see the effort fall apart, said the people, who insisted on anonymity to speak candidly.

Trump now believes that Republicans - who control both the House and the Senate - cannot be trusted to carry bills to passage by themselves and views it as his burden to create a better environment for his legislative agenda to garner support. What matters to him, one Republican lawmaker said, is “putting wins on the board - not the specifics.”

Instead of relentlessly courting members of the conservative, and often intractable, House Freedom Caucus, as he did on health care, Trump wants them to “feel the burn a little bit,” the lawmaker added, framing the new outreach as Trump's way of reminding conservatives in both chambers that he likes them but does not need them.

“They're not the only player he's willing to play with,” said Michael Steele, the former Republican National Committee chairman. “He's saying to them, 'I'll be a free-range President.'”

Senator Ron Johnson, Republican-Wisconsin, who attended Tuesday's dinner, said jump-starting talks on tax cuts and other potential changes remains at the top of Trump's agenda. He said Trump wants to focus cuts on brackets that affect middle-class people.

“Let's face it: If you want tax reform, you want to avoid pitfalls that make it impossible,” Johnson said of Trump's approach on this priority. “Selling tax cuts for the wealthy is pretty impossible.”

“What I saw from the president was a genuine process to find bipartisan agreement on taxes and infrastructure,” Johnson added. “My guess is some Democrats definitely agree with him.”

Manchin said the Tuesday dinner was “a very good, productive meeting,” and said he believes the President, who was once a registered Democrat, is simply entering his legislative comfort zone.

“The president seemed more at ease, more comfortable, talking about finding a bipartisan solution than trying to have to defend a rigid, one-side-only works,” Manchin said. “I think he's able to approach legislation in a total sphere, not just one side.”

Moderate Republicans, in particular, have cheered this development, after long feeling sidelined inside the House as Freedom Caucus members and other conservatives have rebelled against their party's leadership.

Trump's conservative critics, however, said his latest gestures reflect his liberal instincts on some issues and his intense desire for popularity.

“He's always had that itch to liberate himself from the Republican Party,” said William Kristol, a Trump critic and editor at large of the Weekly Standard magazine. “He ran against it in 2015 and 2016, and has attacked it in 2017. He wants to win and doesn't care about the substance of winning.”

Kristol added, “Democratic voters may loathe Trump, but he could conceivably give them lots of policy victories.”

Democrats say they are focused only on working with the President on areas where they believe they can get what they want in terms of their priorities, including protections for the dreamers and federal health-care subsidies for Obamacare. They have vowed not to trade dreamer protections for Trump's long-promised wall at the southern border - and in recent days the White House has indicated the two issues do not have to be linked.

On other issues and with this President, many Democrats remain wary.

Donnelly, despite being wooed by Trump and up for reelection next year, said he feels no pressure to vote for the Republican tax plan if he thinks it's a bad deal.

“If the tax package makes sense, I'll support,” Donnelly said. “If not, I'll pass.”

The halting forays into bipartisanship have proven a new experience for many. At Tuesday's dinner, Manchin was presented with yet another surprise in a week full of them - an apple strudel topped with what looked to be a delicate white egg.

Thousands march against Donald Trump in LGBT rights parade Show all 8 1 /8 Thousands march against Donald Trump in LGBT rights parade Thousands march against Donald Trump in LGBT rights parade A marcher hold a sign that reads "Love is Love is Love" on the National Mall with the Washington Monument in the background during the Equality March for Unity and Pride in Washington AP Thousands march against Donald Trump in LGBT rights parade Marchers unfurl a huge rainbow flag as they prepare to march in the Equality March for Unity and Pride in Washington AP Thousands march against Donald Trump in LGBT rights parade Marchers gather to hear speakers at the end of the Los Angeles LGBTQ #ResistMarch AP Thousands march against Donald Trump in LGBT rights parade Gil Mendez, of San Francisco, holds a sign to honor the victims of the shooting at the Pulse Nightclub in Orlando as he marches during the Equality March for Unity and Pride in Washington AP Thousands march against Donald Trump in LGBT rights parade An demonstrator looks on as LGBT members and their supporters take part of the Equality March for Unity AFP/Getty Images Thousands march against Donald Trump in LGBT rights parade A marcher listens to speakers at the end of the Los Angeles LGBTQ #ResistMarch AP Thousands march against Donald Trump in LGBT rights parade LGBT members and their supporters take part of the Equality March for Unity AFP/Getty Images Thousands march against Donald Trump in LGBT rights parade A marcher mugs for the camera during the Los Angeles LGBTQ #ResistMarch AP

“I'm thinking, 'Boy, what do I do with this?' ” Manchin said. “But I'm thinking, 'When in Rome,' so I take and bite, and, lo and behold, it's ice cream.”

Such is the dilemma facing Democrats in this moment of Trumpian outreach: The perks are enticing, but they are not entirely sure what they're dipping their spoon into.

Donnelly, however, said he had no doubt. “I knew it was ice cream from the start,” he said.