By the time Donald Trump stepped onstage during Lee Greenwood’s rendition of “God Bless the U.S.A.” at the Make America Great Again rally in Duluth, Minnesota, on the evening of June 20, he was confronting the first crisis of his re-election campaign. Wrenching reports of federal agents ripping infants from their parents’ arms—the result of Trump’s “zero tolerance” immigration crackdown at the southern border—had been playing in a constant loop on cable news. Chaos had engulfed the West Wing, too, as officials offered shifting and conflicting explanations for the policy: Trump blamed Democrats; Attorney General Jeff Sessions called it a “deterrent”; Homeland Security Secretary Kirstjen Nielsen said it wasn’t. Press Secretary Sarah Huckabee Sanders refused to appear on-camera to defend the separations, according to two sources close to her. Melania Trump issued a rare statement critiquing her husband’s policy without first clearing it with White House officials, a source said; she even asked her press secretary to call a Trump surrogate and thank him after he derided the policy on CNN.

For much of the country, the situation at the border posed a moral crisis. But for the Trump campaign, the quandary was political. Immigration was not only a Trumpian rhetorical staple—Build the Wall! Mexico Will Pay For It!—but mostly a winning issue for the G.O.P. Now, the news that the United States government had forcibly separated as many as 2,000 children from their families, a number of them with little hope of ever being re-united, was a bridge Republicans weren’t willing to cross with Trump. Michael Hayden, C.I.A. director under George W. Bush, compared the detention camps to Auschwitz. Paul Ryan and Mitch McConnell privately told Trump he would “go down big on the issue,” a Republican briefed on the conversations told me. And so, Trump, who prides himself on an umbilical connection to his base, did the most un-Trumpian of things: he blinked. As the furor over child separations intensified, and with the midterms looming and Robert Mueller circling ever closer, the stakes were existential. “He felt trapped,” recalled a Republican who spoke with the president during the deliberations. Walk the policy back, and he risked angering his hard-line anti-immigration base; dig in and it would further galvanize Democrats and independents to vote against Republicans in November, likely tilting the House, and possibly even the Senate, in their favor, and facilitating the possibility of an impeachment trial. “This election is very simple,” Steve Bannon told me recently. “It’s an up-or-down vote on impeachment.”

For days, Trump had claimed that only Congress could nullify the policy. Shortly before boarding Air Force One for Duluth, however, the president had signed a hastily drafted executive order that effectively ended the family separations. “He was very unhappy,” the Republican who spoke with him recalled. “He was perturbed the immigration issue had gotten out of hand. He’s feeling that being president isn’t as fun as it should be. He thinks he’s not getting the credit he deserves about the economy and North Korea. He said, ‘These people around me don’t know how to sell.’ It’s why he’s going bananas on Twitter. His state of mind is frustration.”

In Duluth, as he stood in front of a sea of red hats, white faces, and blue signs filling the local hockey arena, the frustration melted away. Trump demanded credit for his nuclear summit with Kim Jong Un. (“We had a great meeting, great chemistry.”) He whined that the media would downplay the crowd size. (“Did you see the thousands and thousands of people outside? That will never be reported by the fake news.”) He griped about not being considered a member of the country’s elite. “I have a much better apartment than they do,” he said to the audience. “I’m smarter than they are. I’m richer than they are. I became president and they didn’t.”