The president was riding high as Air Force One ferried him back from his summit with North Korea’s Kim Jong Un last week. Top aides planned a quiet Friday, wanting to ride the perceived momentum into the weekend. Then Trump, without the input of aides, walked out to the North Lawn to talk to Fox News anchor Steve Doocy and then other reporters.

The chaos instantly returned. The momentum had been lost — or, rather, squandered by the boss.

“I certainly wouldn’t sign the more moderate one,” Trump said of a compromise House GOP immigration measure. Though White House aides later walked that back, the damage was done. But this week, Trump shivved the compromise bill one more time and help seal the fate of a conservative one that went down Thursday.

GOP members broke with their practice of standing by the president, angered by the migrant crisis. Then came another presidential blunder: During a House Republican Conference meeting Tuesday night, he mocked Rep. Mark Sanford, who lost his South Carolina 1st District primary earlier in the month after clashing with Trump. He called the former Palmetto State governor and Freedom Caucus member a “nasty guy” and derisively thanked him for running such a “tough race.”

By midweek, Republicans on and off Capitol Hill — in a shift — were publicly criticizing Trump’s policies and behavior.

“I cannot think over my career in this town of a similar terrible week — unless it was George W. Bush’s Hurricane Katrina moment,” said G. William Hoagland, once a senior aide to then-Senate GOP leader Bill Frist.

“This may prove to have been the week that turned a blue wave into a blue tsunami — particularly for the House Republicans,” Hoagland said. “I expect that the president’s base will not abandon him and may even be energized somewhat. But the moderate Republican and independent voters will either quietly vote for the Democratic candidate this fall to put a check on the president or not vote at all.”

The latter could put the House and Senate in Democratic control — and doom Trump’s agenda.

“Honestly, we may look back on this week as the time the wheels really started coming off the wagon,” said Michael Steel, a former senior aide to then-Speaker John A. Boehner, R-Ohio, who also worked for Jeb Bush’s 2016 presidential campaign. “The president can recover, but this was a very, very damaging week. And there needs to be a real effort to refocus the administration on jobs, the economy and national security.”

A White House official declined to comment on the week’s events or the criticism Trump is getting from a growing number of Republicans. But the official, with closed eyes and a grimace, did not dispute the notion that Trump had perhaps the worst week of his 17-month-old presidency. Aides are still piecing together next week’s plans, eager to move on — though GOP members are not there yet.

“President Trump is wrong,” Rep. Erik Paulsen, R-Minn., said Friday of Trump’s demand the party shelve its immigration push. Then he offered a stunningly scathing rebuke of the GOP president: “Unlike the president, I won’t give up on giving DACA recipients certainty and ensuring we’re never separating kids from their parents at the border again.”

Paulsen’s forceful brushback came just a few hours after Trump tweeted that “Republicans should stop wasting their time on Immigration until after we elect more Senators and Congressmen/women in November.”

Trump wants to turn the midterm cycle into a referendum on immigration, setting up a potential clash with members of his own party.

Republicans should stop wasting their time on Immigration until after we elect more Senators and Congressmen/women in November. Dems are just playing games, have no intention of doing anything to solves this decades old problem. We can pass great legislation after the Red Wave!

Rep. Mike Coffman said the president on Tuesday night essentially endorsed the substance of the compromise immigration bill. But the Colorado Republican faulted him for choosing to not “tell the American people which bill he supports.”

Asked if Trump gets the importance of passing an immigration bill — even if it goes nowhere in the Senate — to many Republicans, Coffman replied: “I’m not sure. I don’t understand where the administration is right now on this issue.” He also offered a warning to Trump, saying a large number of Republican members may soon conclude there is “no alternative” than forcing a vote on a bipartisan package.

Marc Hetherington, a political science professor at Vanderbilt University, said the list of presidential missteps this week shows “Trump is not especially adept at being president, at least not insofar as people measure adeptness as the ability to solve problems rather than create them.”

Trump Signs Order to End Family Separation Policy

“That he struggles to maintain 40 percent approval ratings, and has members of his own party deriding him or apologizing for him, says a lot about his political acumen,” Hetherington added. And voters are paying attention: A recent Pew Research Center poll found 68 percent of those surveyed will factor in which party control both chambers when they vote this fall. That’s a historically high level, Pew said, adding that more people (48 percent) plan to vote Democratic than Republican (43 percent).

Shocked Republicans emerged from their Trump session by recounting there was booing followed by silence when he went after Sanford. “It was just awkward," Pennsylvania Rep. Ryan Costello said.

It’s too soon to know the ramifications of that moment. But Sanford said Friday his colleagues are still upset.

“My political sin was I spoke out against the president prior to my election. He came to this chamber and sent a chilling message to my colleagues: If you mess with me, I'll mess with you,” Sanford told CNN.

“I don't think the full story has played out,” Sanford said, saying “there has been pushback” on Trump’s disparaging comments with other Republican members approaching him all week on the chamber floor to say, “I could not disagree more with the president and the signal he tried to send.”

Democrats sense a weakened president.

“The president ran full speed into humanitarian and political disasters, simply because he was too much of his own self,” a senior Democratic Senate aide said Friday. “He can try to point fingers of blame for the bad week he had, but the blame really only lies with him.”

But GOP sources and experts noted the ever-present wildcard in the Trump era.

“No one knows how his base will respond to even the most detestable acts,” Vanderbilt’s Hetherington said. “Among my Trump-supporting friends, the response has been to either ignore the situation at the border or to blame it on Obama.”