Former national security adviser John Bolton was the highest-ranking official in the White House who voiced opposition to the effort to pressure Ukraine, someone with ample authority and motivation to disrupt a shadow foreign policy he reportedly likened to a “drug deal.”

Yet Bolton, who has a reputation as one of the most ruthless bureaucratic warriors in Washington, seemed to find reasons to avoid intervening directly at some key moments in the scandal now threatening the Trump presidency, according to current and former U.S. officials and testimony in the impeachment inquiry. Bolton sent others to report concerns to National Security Council lawyers, but it is unclear whether he went himself. He skipped listening to the July 25 call between President Trump and the leader of Ukraine despite railing in the preceding weeks about the plan to compel Kyiv to open investigations that could help Trump in the 2020 election.

Even now, Bolton is expected to be a no-show for his appointment with impeachment investigators on Thursday, citing legal obstacles that did not impede former aides on the NSC.

As a result, Bolton’s role in the unfolding impeachment saga has become one of the most difficult to ascertain. His hard-line views about Russia, conservative bona fides and ignominious removal from the White House would seem to mark him as an eager and potentially devastating witness against the president. But, at the same time, he may have more to explain than other witnesses on whether he could have done more to stop a scheme he seemed to view as a shakedown.

Current and former U.S. officials said the perception inside the White House was that Bolton was deliberately seeking to protect himself from exposure to any fallout from the attempt to pressure Ukraine. “He was being a very careful political operative — which is what his reputation is,” said a former U.S. official familiar with Bolton’s actions who spoke on the condition of anonymity to discuss internal deliberations. “Bolton wants to continue to be a major player, wants to be relevant,” the official said. He avoided intervening directly in some Ukraine matters “because he knew it was going to be a disaster.”

A spokesman for Bolton said the former national security adviser had no comment.

Bolton first raised his worries about policy toward Ukraine during a volatile July 10 meeting in his White House office with U.S. officials and top aides to the Ukrainian president. The discussion was proceeding normally until Gordon Sondland, the ambassador to the European Union and a key driver of the shadow policy, made a cryptic reference to reviving investigations important to Trump.

Bolton immediately understood Sondland was pressing the Ukrainians to pursue a probe into Burisma, an energy company that had hired Vice President Joe Biden’s son Hunter to be on its board.

Bolton abruptly cleared the group from his office, officials said. When Sondland tried to reconvene with the Ukrainians downstairs, Bolton dispatched his then-Russia adviser, Fiona Hill, to break it up.

“I’m not part of whatever drug deal Sondland and Mulvaney are cooking up,” Bolton told Hill, according to her testimony. Bolton directed Hill to report what she had witnessed with Sondland to John Eisenberg, the top lawyer for the NSC.

It is not clear whether Bolton also spoke to Eisenberg or raised his concerns about the issue with Trump. Two weeks later, Bolton insisted that he alone, and not Sondland, handle Trump’s pre-call brief ahead of the president’s July 25 conversation with Volodymyr Zelensky, the Ukrainian president, according to U.S. officials.

Bolton briefed the president, who was in the White House residence. When he finished, Sondland was patched through on a separate call with the help of acting White House chief of staff Mick Mulvaney, according to the U.S. officials. One week earlier, Trump had halted nearly $400 million in military aid to Ukraine over the objections of most of his top national security experts, including Bolton.

Despite the rancor in the run-up to the call and the troubling hold on the aid, Bolton chose not to listen in to the president’s conversation with Zelensky in the Situation Room with other top officials. Instead, he dispatched his deputy to monitor it and report back.

At the same time, senior officials across the Pentagon, State Department and CIA were scrambling to figure out the reason for the hold. Interagency staff members convened at least three times to make the case for the money. The Pentagon produced an analysis certifying the effectiveness of the assistance and calling for it to be restored.

Most officials expected Bolton to call a meeting of the president’s national security cabinet to reaffirm the need for the assistance and put more pressure on Trump to release the money.

Privately, Bolton gave others the indication that he was pursuing the matter internally. Acting U.S. ambassador to Ukraine William B. Taylor Jr. testified in the impeachment inquiry that Bolton informed him at one point that he was working to enlist the “two secretaries” — an apparent reference to Secretary of State Mike Pompeo and Secretary of Defense Mark T. Esper — as well as CIA Director Gina Haspel to get the hold on military aid reversed.

But August passed without a meeting. “It just seemed to sit for the month,” said a senior administration official. “No one knew why it wasn’t happening.”

Separately, Bolton was on increasingly shaky ground with Trump, who was frustrated that his national security adviser’s “maximum pressure campaigns” on Iran and Venezuela were not showing faster results. The national security adviser was also feuding with Pompeo over a proposed peace deal in Afghanistan that Bolton believed made too many concessions to the Taliban.

In late August Bolton flew to Kyiv to meet with Zelensky. Before departing, he told aides that he wanted to “stay out of politics,” according to a text message written by Taylor and released as part of the impeachment inquiry.

Kurt Volker, the U.S. special envoy to Ukraine, told House investigators that he assumed that meant Bolton wanted to avoid discussions related to Rudolph W. Giuliani, Trump’s personal lawyer, who was pressuring Kyiv for investigations of Joe Biden and his son, as well as unfounded allegations of Ukrainian involvement in the 2016 election, a conspiracy theory Giuliani appeared to have embraced.

In Bolton’s mind, Giuliani was a “hand grenade who’s going to blow everybody up,” according to testimony in the impeachment inquiry.

In Kyiv, Bolton did not discuss the freeze on military aid with Zelensky’s aides, who, despite the mounting worry in Washington, did not realize it was on hold. Instead, his talks focused on U.S. concerns regarding the pending sale of a Ukrainian aerospace company to the Chinese. “That was the focal point for him, not the aid or investigations,” said a former U.S. official with knowledge of his trip.

During his visit, Bolton met with Taylor and encouraged the acting ambassador to send a diplomatic cable to Pompeo voicing his concern about the apparent withholding of aid as leverage against Ukraine. Taylor testified that he did so the next day, Aug. 28.

When Politico published a piece on the aid freeze, Zelensky and his top aides were left wondering why Bolton had not mentioned the issue before departing Ukraine.

Five days later, Bolton and Vice President Pence were scheduled to meet with Zelensky and his top aides on the sidelines of a World War II commemoration in Warsaw. The morning of the meeting, Taylor warned the Ukrainians that if the money was not released by Sept. 30, they would lose it.

It was an “all or nothing proposition” he told Ukraine’s national security adviser, according to Taylor’s testimony.

Meanwhile, Bolton and Pence were huddling in Warsaw to discuss how to address the frozen aid. The meeting with the vice president offered Bolton an opportunity to sound the alarm about Giuliani’s and Sondland’s actions at the highest levels of the administration.

But he chose not to discuss his concerns with Pence, U.S. officials said. Bolton emphasized the importance of the aid to Ukraine but held his tongue on the pressure campaign. Officials close to Pence say he was unaware of Trump’s efforts to press Zelensky for damaging information about Biden and his son. Pence had access to the transcript of the July 25 phone call, but it is unclear whether he read it.

In the meeting with Pence, Zelensky made a case for the American aid, which he said was important not only militarily but also as a symbol of American commitment in the face of Russian aggression.

“You are the only country providing military assistance,” one of the Ukrainian officials told Pence. “You are punishing us.”

Pence offered no explanation for the hold beyond a vague insistence that the Ukrainians crack down on corruption, then promised to raise the matter with Trump in Washington.

Bolton, meanwhile, was quiet and left the session before it was over to catch his plane, according to U.S. and Ukrainian officials. Bolton’s brief appearance left the Ukrainians wondering whether he was avoiding them, officials in Kyiv said.

Nine days later, Trump, under heavy pressure from a bipartisan group of lawmakers, authorized the release of the Ukrainian aid. He also tweeted that he had fired Bolton, who had clashed with Trump on Iran, Syria, North Korea, Venezuela and Afghanistan policy.

Bolton texted his rejoinder to a handful of reporters: “Let’s be clear: I resigned.”

In the weeks that followed, Bolton blasted Trump’s North Korea policy in a speech, inked a lucrative book deal and restarted his political action committee, which supports Republican candidates who share his hard-edge foreign policy views.

He has also watched from the sidelines as three of his former subordinates have come forward to testify in the House impeachment inquiry, defying the White House’s orders that they keep quiet.

Bolton has indicated he is in a different legal category than other witnesses because of his rank and is waiting on a decision from the courts on whether he should comply with the White House’s order or Congress’s subpoena.

Sonne reported from Kyiv. David L. Stern in Kyiv contributed to this report.