The idea of a daring wartime trip by Volodymyr Zelenskyy to Washington had percolated for some time before the surprise visit was revealed just hours ahead of the Ukrainian president’s arrival.

During an October summit in Zagreb, U.S. House Speaker Nancy Pelosi discussed with her counterpart in the Ukrainian parliament the prospect of Zelenskyy addressing the U.S. Congress. Similarly, Biden administration officials had for months talked with Ukraine about a Zelenskyy visit to the White House, hoping for one before year’s end to send an unmistakable signal of support ahead of a brutal winter that could deepen Russian President Vladimir Putin’s assault.

In previous calls, Zelenskyy had indicated to President Joe Biden and other senior officials that the United States was the first country he wanted to visit when the time was right for him to travel, according to a U.S. official with knowledge of the conversations. So, in a December 11 phone call between the two leaders, Biden reiterated the invitation.

This time, Zelenskyy told Biden, was the right time.

“I really wanted to come earlier. Mr. President knows about it, but I couldn’t do it because the situation was so difficult,” Zelenskyy said from the Oval Office on Wednesday. The trip could happen now, the Ukrainian leader said, because “we controlled the situation and … first of all, because of your support.”

Ensuring a swift, safe journey

The behind-the-scenes details of Zelenskyy’s surprise visit to Washington were described by an aide to Pelosi, a U.S. official and a senior administration official, all of whom requested anonymity to describe planning for the secret trip. Once the wheels of planning started to roll, Zelenskyy’s 10-hour visit — which packed in an Oval Office meeting with Biden, a joint news conference at the White House and an address to a largely supportive Congress — came together quickly.

What came about Wednesday was an elaborately executed plan by U.S. and Ukrainian officials to swiftly and safely route Zelenskyy to Washington, his first known trip outside the country’s borders since Russia’s invasion in February.

The Ukrainian president crossed into Poland early Wednesday, according to Poland’s private broadcaster, TVN24, arriving at a train station in Przemysl, a border town and the arrival point for many refugees fleeing the war. Accompanied by the U.S. ambassador to Ukraine, Bridget Brink, Zelenskyy was transported in a U.S. Embassy vehicle to an airport in Rzeszow, where he boarded a nonstop flight that landed at Joint Base Andrews shortly after noon Wednesday.

Carrying Zelenskyy to Andrews was a U.S. Air Force jet — a government plane typically used for Cabinet secretaries and other dignitaries below the president and vice president. The White House didn’t publicly announce the impending Zelenskyy visit until 1 a.m. Wednesday — waiting until they felt Zelenskyy was safely out of Ukraine.

Once Zelenskyy landed, Secret Service protection kicked in, as is typically done for visiting heads of state.

Paving the way

The senior administration official said the U.S. consulted closely with Zelenskyy on his security, and that the Ukrainian president felt it was sufficient for him to travel to the United States briefly.

Meanwhile, Pelosi had been planting the seeds for months for a Zelenskyy address to Congress.

She had been at the Zagreb summit in October at the invitation of Zelenskyy and Ruslan Stefanchuk, the speaker of the Ukrainian parliament. There, Zelenskyy spoke to the audience of “the importance of the free world’s unshakable solidarity with Ukraine” — an address that Pelosi emphasized in her invitation to the Ukrainian president.

The U.S. House speaker returned from Croatia and began discussing the idea of a Zelenskyy address, informing other congressional leaders — Senate Majority Leader Chuck Schumer, House Minority Leader Kevin McCarthy and Senate Minority Leader Mitch McConnell — about her conversations abroad and asking for their support for the Ukrainian leader to come to the Capitol.

On Wednesday, Pelosi — just days away from handing over her gavel to Republican control — welcomed Zelenskyy to the Capitol, which she called a “profound privilege” and a “great pride,” coming at a moment when Capitol Hill is about to greenlight an additional $45 billion in emergency aid to Ukraine.

Before he left Ukraine, there were clues in Zelenskyy’s own words that a surprise trip abroad could be in the works.

In a visit Tuesday to Bakhmut, located in Ukraine’s contested Donetsk province, Zelenskyy was handed a Ukrainian flag. He pledged then that he would pass on the flag “from the boys to the Congress, to the president of the United States.”

Vice President Kamala Harris, left, and House Speaker Nancy Pelosi, right, smile as Ukrainian President Volodymyr Zelenskyy presents lawmakers with a Ukrainian flag — signed by troops serving in Ukraine's contested Donetsk province — as he addresses a joint meeting of Congress in Washington, Dec. 21, 2022.

Vice President Kamala Harris, left, and House Speaker Nancy Pelosi, right, smile as Ukrainian President Volodymyr Zelenskyy presents lawmakers with a Ukrainian flag — signed by troops serving in Ukraine’s contested Donetsk province — as he addresses a joint meeting of Congress in Washington, Dec. 21, 2022.

Standing before the U.S. Congress on Wednesday night, Zelenskyy produced the flag — covered in signatures by Ukrainian troops battling on the front lines.

“They asked me to bring this flag to you, to the U.S. Congress, to members of the House of Representatives and senators whose decisions can save millions of people,” Zelenskyy said in his final words to lawmakers. “So let these decisions be taken. Let this flag stay with you. Ladies and gentlemen, this flag is a symbol of our victory in this war.”