KYIV, Ukraine — William Taylor has emerged as an unlikely central player in the events that are at the heart of the impeachment inquiry of President Donald Trump.

The retired career civil servant was tapped to run the U.S. Embassy in Ukraine after the administration abruptly ousted the ambassador. He was then drawn into a Trump administration effort to leverage U.S. military aid for Ukraine.

And then he apparently grew alarmed.

"I think it's crazy to withhold security assistance for help with a political campaign," he wrote at one point in excerpts of text messages released by impeachment investigators in Congress.

Now, members of Congress will hear directly from Taylor. The former Army officer is scheduled to testify behind closed doors Tuesday in an inquiry trying to determine if Trump committed impeachable offenses by pressing the president of Ukraine into pursuing information that could help his campaign as he withheld military aid to the Eastern European country.

Taylor had been serving as executive vice president at the U.S. Institute of Peace, a nonpartisan think tank founded by Congress when he was appointed to run the embassy in Kyiv after Ambassador Marie Yovanovitch was removed before the end of her term following a campaign against her led by Trump's personal lawyer, Rudy Giuliani.

He was chosen for the post because he was among only a handful of former officials with experience in Ukraine who would be perceived as neutral by local officials and wouldn't raise objections at the White House, according to a colleague.

"It was a very short list, but Bill was at the top of it," said the colleague, who was not authorized to speak publicly and spoke on condition of anonymity. "We were very grateful he agreed to do it."

Taylor, who had served as U.S. ambassador to Ukraine from 2006 to 2009, was welcomed back to Kyiv as a steady hand.

"He's the epitome of a seasoned statesman," said John Shmorhun, an American who heads the agricultural company AgroGeneration.

He said Taylor's experience has shown in his handling of the Trump administration's efforts to pressure Ukraine. "He seems to know the difference between right and wrong," Shmorhun said.

"We need guys like Bill Taylor working in Ukraine, helping to deal with the politics in Ukraine, having a strong arm."

Before retiring from government service, Taylor was involved in diplomatic efforts surrounding several major international conflicts. He served in Jerusalem as U.S. envoy to the Quartet of Mideast peacemakers. He oversaw reconstruction in Iraq from 2004 to 2005, and from Kabul coordinated U.S. and international assistance to Afghanistan from 2002 to 2003.

He is a graduate of West Point and served as an Army infantry platoon leader and combat company commander in Vietnam and Germany.

He arrived in Kyiv a month after the sudden departure of Yovanovitch and the inauguration of Ukraine's new president, prepared to steer the embassy through the transition. He was most likely not prepared for what happened next.

In July, Trump would have his now-famous phone conversation with President Volodymyr Zelenskiy in which he pressed him to investigate unsubstantiated claims about Democratic rival Joe Biden and a debunked conspiracy theory involving a computer server at the Democratic National Committee. Trump at the time had quietly put a hold on nearly $400 million in military aid that Ukraine was counting on in its fight against Russian-backed separatists.

In the follow-up to the call, Taylor exchanged texts with two of Trump's point men on Ukraine as they were trying to get Zelenskiy to commit to the investigations before setting a date for a coveted White House visit.

In a text message to Gordon Sondland on Sept. 1, Taylor bluntly questioned Trump's motives: "Are we now saying that security assistance and WH meeting are conditioned on investigations?" Sondland, U.S. ambassador to the European Union, told him to call him.

In texts a week later to Sondland and special envoy Kurt Volker, Taylor expressed increased alarm, calling it "crazy to withhold security assistance for help with a political campaign."

He said not giving the military aid to Ukraine would be his "nightmare" scenario because it sends the wrong message to both Kyiv and Moscow. "The Russians love it. (And I quit)."

In a stilted reply, Sondland defended Trump's intentions and suggested they stop the back and forth by text.

U.S. diplomats based at the Kyiv embassy have refused to speak with journalists, reflecting the sensitivity of the impeachment inquiry. The embassy press office did not respond to a request for comment on Monday.

Publicly, as in his texts, Taylor has continued to stand up for Ukraine, a country he describes as on "the front lines" of a war with Russia.

Speaking to university students on Aug. 31, Taylor said Ukraine was showing its commitment to a "democratic, European, prosperous future" and could count on U.S. support.

"We know you have challenges. We know your large neighbor has started a war against your country. We stand with you in resisting that aggression," Taylor said, according to remarks published on the embassy website.

It was a message that would be repeated in a "Music of Freedom" concert this past weekend by the U.S. Air Forces in Europe Band performing together with Ukrainian musicians.

Joseph Pennington, the acting No. 2 while Taylor is in Washington, addressed the mostly Ukrainian audience, saying he hoped they would "feel the support and commitment to democracy that our two countries cherish" and "recognize the power of the enduring partnership between the United States and Ukrainian armed forces."

The lyrics of the first song, "Over There," may have been lost on many in the audience as the refrain "the Yanks are coming" cheerfully rang out in the Kyiv concert hall.

But there was no missing the parting words from Pennington: "Glory to Ukraine."