President Trump was visibly delighted. As he took the stage at the annual National Prayer Breakfast in Washington on Thursday, his eye was drawn to newspapers laid out on a long table by the lectern. He picked up a copy of USA Today and held it up. “Acquitted,” read the headline. Then, with the architect of his impeachment — House Speaker Nancy Pelosi — standing nearby, he grabbed a copy of the Washington Post and popped his eyes in mock surprise at the typeset: “Trump Acquitted.”

Trump held up the same newsprint in the East Room of the White House when he crowed about his acquittal to reporters three hours later at the start of a rambling, celebratory speech that painted his impeachment as part of a long arc of efforts to try to oust him, going back to the FBI’s investigation into Russia’s effort to help Trump win the 2016 election. “It was evil. It was corrupt. It was dirty cops. It was leakers and liars. And this should never ever happen to another President ever,” Trump said.

Trump’s acquittal was a moment that many in Washington talked about as the inevitable outcome of the impeachment process, once the evidence the House managers gathered hit the political realities in the GOP-controlled Senate. But inside Trump’s inner circle, it wasn’t always clear that the President would be able to contain the drumbeat of negative headlines and keep Republicans on board for the long months from House Speaker Nancy Pelosi’s announcement of the inquiry on Sept. 24 to the President’s acquittal on Feb. 5.

Here are the three main ways Trump managed to land the acquittal, according to conversations with multiple White House officials, people close to Trump, political strategists and experts on Presidential history.

Trump stonewalled the House

It was an audacious move. After Trump’s legal team decided to release the record of Trump’s July 25 call with Ukraine President Volodymyr Zelensky, the White House pulled up the drawbridge and refused to cooperate with any House investigations into Trump’s demands of Ukraine. White House counsel Cipollone’s scathing Oct. 8 letter to House leaders called the entire impeachment inquiry “constitutionally invalid” and refused to provide any documents or first hand witnesses.

That turned out to be strategically crucial, limiting House Democrats’ access to first-hand information. It also set a new precedent for outsized use of Presidential power. “Donald Trump is the first president ever to put up a complete stonewall and obstruct the work of a House impeachment inquiry,” says Timothy Naftali, a presidential historian at New York University and a former director of the Richard Nixon Presidential Library and Museum. “All his predecessors understood there was something very unique about an impeachment inquiry. This one didn’t.”

How Trump would fight impeachment took time to come into focus. Early in the fall, as news first broke about Trump’s request that Ukraine investigate the Bidens, some close to the President panicked. Immediately, factions inside the West Wing butted heads over how to respond.

One camp, led by Trump’s White House counsel Pat Cipollone, advocated for sticking with the West Wing’s legal team and not building out a war room of outside lawyers for handling what they argued was an illegitimate and rushed impeachment inquiry. A war room would signal panic, they argued, and the Democrats would seize on that.

Another group around Acting Chief of Staff Mick Mulvaney thought Cipollone, an accomplished civil litigator with limited political experience, was out of his depth and needed more help herding the tribal factions on the Hill and managing the press.

Things got so bad that at one point in the fall, there were two separate morning meetings about impeachment strategy being held in the West Wing, one headed by Cipollone and another in Mulvaney’s office. The two camps weren’t working together, according to three White House officials who described the discussions. The tensions came to a head when Mulvaney, during a disastrous press conference in October, seemed to acknowledge that Trump withheld military aid to Ukraine to apply pressure for investigations—a central question in the impeachment inquiry.

As tempers flared, Trump’s son-in-law and senior advisor Jared Kushner weighed in. Kushner ushered in a compromise: the legal team would still report to Cipollone and no massive outside operation would be launched to defend Trump. But a few people would be brought in temporarily to help. Tony Sayegh, a former top spokesman for Trump’s Treasury Department who had played a big role in ushering through the 2017 tax cuts, helped White House’s legislative affairs director Eric Ueland handhold Republicans on the Hill. Pam Bondi, a former attorney general of Florida and a regular face on conservative news shows, helped crafting the communications response and with the care and feeding of conservative media.

“It’s invaluable to do that,” says a White House official, referring to having enough aides to talk regularly with GOP lawmakers and conservative pundits. “Otherwise you’re just over here doing bunker mentality type stuff and people aren’t hearing from you.”

Republicans stuck together

The impeachment proceedings didn’t eat into Trump’s high popularity among Republicans. In fact, the Gallup polling found Trump’s approval among Republican voters ticked up by six points over the month of January, rising to 94 percent.

With that number comes power. Trump’s allies have made it clear that breaking with Trump would have a political price. After Romney became the only Republican on Wednesday who voted to convict Trump of abuse of power, Trump’s son Don Jr. tweeted that Romney is “now officially a member of the resistance & should be expelled from the @GOP.”

Earlier, when the impeachment vote came to the floor of the House on Dec. 18, the White House scrambled to ensure that no Republicans would vote against Trump. White House officials believed Rep. Will Hurd, a moderate Republican from Texas who served in the CIA, was considering breaking ranks but ultimately voted against impeachment. Trump thanked House Minority Leader Kevin McCarthy on Thursday for keeping House Republicans together and keeping Democrats from being able to say they got a bipartisan impeachment vote. “Damn, did you do a job,” Trump told McCarthy, predicting that the political fallout from impeachment would make him Speaker of the House after the next elections. “We’re lucky you’re there,” Trump said.

By the time the impeachment case made it to the Senate for trial, Trump told aides he also wanted household names like Ken Starr and Alan Dershowitz defending him, and they came on board to help craft Trump’s public defense. Trump called his legal team “warriors” on Thursday. “I call them friends because you know you develop friendships and relationships when you’re in battle and war,” he said, adding: “You have to focus on this because it can get away very quickly, no matter who you have with you it can get away very quickly.”

Ultimately, Trump’s legal team settled on a three-pronged defense to keep Republicans onboard. First, they argued that the entire impeachment was invalid because the House didn’t hold a vote before issuing subpoenas. This is the reason Trump’s lawyers used for refusing to make documents or witnesses available to the House. Rep. Adam Schiff, the lead House impeachment manager in the Senate trial, said during the trial that those subpoenas had also been issued in the course of the House’s regular oversight of the President and didn’t require an authorizing vote.

Trump’s lawyers further argued that the House evidence was based on hearsay and conjecture and didn’t have enough first hand accounts to link any wrongdoing to the President himself. House Democrats both said they had made their case and that Trump had blocked their attempts to get more direct evidence from eyewitnesses, such as National Security Adviser John Bolton. On Jan. 26, a report was published that a draft of Bolton’s book claimed Trump directly asked him to cut off aid to Ukraine to pressure them into launching investigations. But without the votes to call Bolton to the Senate floor, Bolton’s claims weren’t aired.

Finally, Trump’s legal team argued that even if Trump had done what the House impeached him for — abuse of power and obstruction of Congress — the actions didn’t rise to a level requiring Trump’s removal. Trump’s legal team, especially Dershowitz, leaned on that argument harder after Bolton’s allegations came to light. This was the reasoning that the Tennessee Senator Lamar Alexander, who at one point was thought to have been a possible defector, gave for his decision not to vote for witnesses in the trial. Ultimately, only two Republicans — Romney of Utah and Sen. Susan Collins of Maine — voted in favor of calling witnesses.

“Let’s face it, they never found a smoking gun, they never had a blue dress,” said a White House official. “And as much as you think the President did something wrong or that he was directing this and behind that, until you have solid evidence, how are you supposed to take the guy off the ballot and remove him from office?”

In the end, voters were unmoved

When the House went through the process of building the impeachment case, they were unable to convince enough of the public that Trump should be removed, which would have compelled Senators to vote differently. Throughout the fall, polls showed that slightly less than half of Americans thought Trump should be removed from office. Even as Democrats built their case and more information became public, those numbers did not inch up, despite Trump’s low approval ratings. Instead, American’s views of Trump became more entrenched over the past four months. In fact, in recent weeks, polling by Gallup has seen Trump’s approval ratings tick up to 49 percent, the highest that poll has registered since Trump took office.

“They didn’t create the critical mass they would need to get a conviction,” says David Winston, a longtime Republican strategist and pollster. Winston estimates that more than 60 percent of the public would have to support removing a President for a Senate to vote to convict. This was by design, said Winston. The founders, by requiring two-thirds of the Senate to agree to remove the President, intentionally wanted there to be an overwhelming amount of public support for the drastic move.

“They never moved the needle at all,” says Winston. “It became purely Democrats wanting to get rid of a Republican President.”

Get our Politics Newsletter. The headlines out of Washington never seem to slow. Subscribe to The D.C. Brief to make sense of what matters most. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Contact us at letters@time.com.