WASHINGTON — Deep into a long flight to Japan aboard Air Force One with President Donald Trump, Mick Mulvaney, the acting White House chief of staff, dashed off an email to an aide back in Washington.

“I’m just trying to tie up some loose ends,” Mulvaney wrote. “Did we ever find out about the money for Ukraine and whether we can hold it back?”

It was June 27, more than a week after Trump had first asked about putting a hold on security aid to Ukraine, an embattled American ally, and Mulvaney needed an answer.

The aide, Robert B. Blair, replied that it would be possible, but not pretty. “Expect Congress to become unhinged” if the White House tried to countermand spending passed by the House and Senate, he wrote in a previously undisclosed email.

Blair was right, even if his prediction of a messy outcome was wildly understated. Trump’s order to hold $391 million worth of sniper rifles, rocket-propelled grenades, night vision goggles, medical aid and other equipment the Ukrainian military needed to fight a grinding war against Russian-backed separatists would help pave a path to the president’s impeachment.

The Democratic-led inquiry into Trump’s dealings with Ukraine this spring and summer established that the president was actively involved in parallel efforts — both secretive and highly unusual — to bring pressure on a country he viewed with suspicion, if not disdain.

Advertising

One campaign, spearheaded by Rudy Giuliani, the president’s personal lawyer, aimed to force Ukraine to conduct investigations that could help Trump politically, including one focused on a potential Democratic 2020 rival, former Vice President Joe Biden.

The other, which unfolded nearly simultaneously but has gotten less attention, was the president’s demand to withhold the security assistance. By late summer, the two efforts merged as American diplomats used the withheld aid as leverage in the effort to win a public commitment from the new Ukrainian president, Volodymyr Zelenskiy, to carry out the investigations Trump sought into Biden and unfounded or overblown theories about Ukraine interfering in the 2016 election.

Interviews with dozens of current and former administration officials, congressional aides and others, previously undisclosed emails and documents, and a close reading of thousands of pages of impeachment testimony provide the most complete account yet of the 84 days from when Trump first inquired about the money to his decision in September to relent.

What emerges is the story of how Trump’s demands sent shock waves through the White House and the Pentagon, created deep rifts within the senior ranks of his administration, left key aides like Mulvaney under intensifying scrutiny — and ended only after Trump learned of a damning whistleblower report and came under pressure from influential Republican lawmakers.

Opposition to the order from his top national security advisers was more intense than previously known. In late August, Defense Secretary Mark T. Esper joined Secretary of State Mike Pompeo and John Bolton, the national security adviser at the time, for a previously undisclosed Oval Office meeting with the president where they tried but failed to convince him that releasing the aid was in interests of the U.S.

By late summer, top lawyers at the Office of Management and Budget who had spoken to lawyers at the White House and the Justice Department in the weeks beforehand, were developing an argument — not previously divulged publicly — that Trump’s role as commander in chief would simply allow him to override Congress on the issue.

Advertising

Those carrying out Trump’s orders on the aid were for the most part operating in different lanes from those seeking the investigations, including Giuliani and a number of senior diplomats, including Gordon D. Sondland, the ambassador to the European Union, and Kurt D. Volker, the State Department’s special envoy for Ukraine and Russia.

Mulvaney is said by associates to have stepped out of the room whenever Trump would talk with Giuliani to preserve Trump’s attorney-client privilege, leaving him with limited knowledge about their efforts regarding Ukraine. Mulvaney has told associates he learned of the substance of Trump’s July 25 call weeks after the fact.

Yet testimony before the House suggests a different picture. Fiona Hill, a top deputy to Bolton at the time, told the impeachment inquiry about a July 10 White House meeting at which Sondland said Mulvaney had guaranteed that Zelenskiy would be invited to the White House if the Ukrainians agreed to the investigations — an arrangement that Bolton described as a “drug deal,” according to Hill.

At the center of the maelstrom was the Office of Management and Budget, a seldom-scrutinized arm of the White House that during the Trump administration has often had to find creative legal reasoning to justify the president’s unorthodox policy proposals.

In the Ukraine case, however, shock about the president’s decision spread across America’s national security apparatus — from the National Security Council to the State Department and the Pentagon. By September, after the freeze had become public and scrutiny was increasing, the blame game inside the administration was in full swing.

On Sept. 10, the day before Trump changed his mind, a political appointee at the budget office, Michael P. Duffey, wrote a lengthy email to the Pentagon’s top budget official, with whom he had been at odds throughout the summer about how long the agency could withhold the aid.

Advertising

He asserted that the Defense Department had the authority to do more to ensure that the aid could be released to Ukraine by the congressionally mandated deadline of the end of that month, suggesting that responsibility for any failure should not rest with the White House.

Forty-three minutes later, the Pentagon official, Elaine McCusker, hit send on a brief but stinging reply.

“You can’t be serious,” she wrote. “I am speechless.”

‘We Need to Hold It Up’

For top officials inside the budget office, the first warning came on June 19.

Informed that the president had a problem with the aid, Blair called Russell T. Vought, the acting head of the Office of Management and Budget. “We need to hold it up,” he said, according to officials briefed about the conversation.

The U.S. had been planning to provide $391 million in military assistance to Ukraine in two chunks: $250 million allocated by the Pentagon for war-fighting equipment — from sniper rifles to rocket-propelled grenade launchers — and $141 million controlled by the State Department to buy night-vision devices, radar systems and yet more rocket-grenade launchers.

With the money having been appropriated by Congress, it would be hard for the administration to keep it from being spent by the end of the fiscal year on Sept. 30.

Advertising

The task of dealing with the president’s demands fell primarily to a group of political appointees in the West Wing and the budget office, most with personal and professional ties to Mulvaney.

The single largest chunk of the federal government’s annual discretionary budget, some $800 billion a year, goes to the Pentagon, spy agencies and the Department of Veterans Affairs. The career official in charge of managing the flow of all that money for the budget office is an Afghanistan War veteran named Mark Sandy.

After learning about the president’s June 19 request, Sandy contacted the Pentagon to learn more about the aid package. He also repeatedly pressed Duffey about why Trump had imposed the hold in the first place.

It was easy enough for the White House to hold up the State Department portion of the funding. Since the State Department had not yet notified Congress of its plans to release the money, all it took was making sure that the notification did not happen.

Freezing the Pentagon’s $250 million portion was more difficult, since the Pentagon had already certified that Ukraine had met requirements set by Congress to show that it was addressing its endemic corruption and notified lawmakers of its intent to spend the money.

So on July 19, Duffey proposed an unusual solution: Sandy should attach a footnote to a routine budget document saying the money was being temporarily withheld.

Advertising

A Pivotal Day

For a full month, the fact that Trump wanted to halt the aid remained confined primarily to a small group of officials.

That ended on July 18, when a group of top administration officials meeting on Ukraine policy learned from a midlevel budget office official that the president had ordered the aid frozen.

That same day, aides on the House Foreign Affairs Committee received four calls from administration sources warning them about the hold and urging them to look into it.

A week later came Trump’s fateful July 25 call with Zelenskiy. Bolton, the national security adviser, had recommended the call take place in an effort to end the “incessant lobbying” from officials like Sondland that the two leaders connect.

By that point, officials in Ukraine were getting word that something was up. At the same time, the effort to win a commitment from the Ukrainians for the investigations sought by Trump was intensifying, with Giuliani and a Zelenskiy aide, Andriy Yermak, meeting in Madrid on Aug. 2 and diplomats Sondland and Volker also working the issue.

And inside the intelligence community, a CIA officer was hearing talk about the two strands of pressure on Ukraine, including the aid freeze. Seeing how they fit together, he was alarmed enough that by Aug. 12 he would take the extraordinary step of laying them out in detail in a confidential whistleblower complaint.

Advertising

The National Security Team Intervenes

Inside the administration, pressure was mounting on Trump to reverse himself.

Backed by a memo saying the National Security Council, the Pentagon and the State Department all wanted the aid released, Bolton made a personal appeal to Trump on Aug. 16, but was rebuffed.

On Aug. 28, Politico published a story reporting that the assistance to Ukraine had been frozen. After more than two months, the issue, the topic of fiery internal debate, was finally public.

Bolton’s relationship with the president had been deteriorating for months, and he would leave the White House weeks later, but on this front he had powerful internal allies.

On a sunny, late-August day, Bolton, Esper and Pompeo arrayed themselves around the Resolute desk in the Oval Office to present a united front, the leaders of the president’s national security team seeking to convince him face to face that freeing up the money for Ukraine was the right thing to do. One by one they made their case.

Trump responded that he did not believe Zelenskiy’s promises of reform. He emphasized his view that corruption remained endemic and repeated his position that European nations needed to do more for European defense.

Advertising

“Ukraine is a corrupt country,” the president said. “We are pissing away our money.”

An Abrupt Reversal

Democrats in the House were gearing up to limit Trump’s power to hold up the money to Ukraine, and the chairmen of three House committees had also announced on Sept. 9 that they were opening an investigation.

Still, White House officials did not expect anything to change, especially since Trump had repeatedly rejected the advice of his national security team.

But then, just as suddenly as the hold was imposed, it was lifted. Trump, apparently unwilling to wage a public battle, told influential Republican Sen. Rob Portman of Ohio that he would let the money go.

The debate would now begin as to why the hold was lifted, with Democrats confident they knew the answer.

“I have no doubt about why the president allowed the assistance to go forward,” said Rep. Eliot L. Engel, D-N.Y., the chairman of the House Foreign Affairs Committee. “He got caught.”