For more than three weeks, House Speaker Nancy Pelosi and her staff had quietly planned an international trip to Brussels and Afghanistan to check in on America’s longest war. Like most congressional delegations—“CODELs”—it was time-consuming work, involving coordination between numerous agencies, stakeholders, and international officials along with extra security briefings because of the danger of the destination.

Pelosi’s chief of staff worked with a liaison from the U.S. Air Force who was the lead in setting up travel arrangements and the itinerary for the trip. Senior officials at the Pentagon also had been read in on the speaker’s plans, especially those regarding her visit to war-torn Afghanistan, where extra security was needed for her time in Kabul. Two senior officials on the ground in Afghanistan said they received the itinerary for the trip, as they do other congressional trips, weeks in advance and held it close to the chest. Fellow members of Congress made similar accommodations as they prepared to accompany the Speaker on the CODEL.

And then, with minutes to go before they departed, President Trump pulled the plug.

“I am sorry to inform you that your trip to Brussels, Egypt, and Afghanistan has been postponed,” Trump wrote in a letter to Pelosi. “We will reschedule this seven-day excursion when the Shutdown is over.”

“Obviously, if you would like to make your journey by flying commercial, that would certainly be your prerogative,” Trump wrote.

Trump’s stated reason in cancelling the CODEL was the fact that the government remains shut down. But the more obvious explanation was that the president had been searching for a way to fire back at the speaker after she had informed him that his State of the Union address would be postponed until a resolution on the shutdown was reached.

Left unappreciated by the back and forth was just how impulsive the president’s swift response truly was.

White House officials told CNN that Trump had coordinated with the Department of Defense about the decision to prohibit the use of military aircraft for Pelosi. But as of the time of this publication, staffers in the Pentagon were furiously scrambling to gather information about the cancellation.

“We’re still gathering information just like you,” one Pentagon official told The Daily Beast. “We are trying to figure out what is going on.” One other source inside the Pentagon said that the White House had not coordinated with senior officials in Kabul about the cancellation, either.

The White House did not respond to The Daily Beast’s question on whether or not the president or his team directly contacted the Defense Department and the Air Force about restricting Pelosi or her team’s use of military aircraft, prior to issuing the White House announcement Thursday afternoon. But the president’s team appeared prepared for the moment in other ways.

Within an hour of the White House’s announcement, the Trump campaign was already fundraising off of the tit-for-tat. The Trump Make America Great Again Committee, a joint fundraising account for the campaign and the Republican National Committee, blasted out an email with the subject line “I’m disinvited?”

“Democrats have illegitimately ‘disinvited’ me from making my scheduled and VERY important State of the Union Address,” the email complained. “Americans DEMAND the truth, so we need to make a CLEAR STATEMENT and raise $1,OOO,OOO by Midnight TONIGHT to show your support for Border Security (the REAL security concern).”

Pelosi’s trip was to come during a particularly sensitive geopolitical moment. The Speaker was to stop in Brussels to meet with top NATO commanders amid Trump’s continued criticism of the transcontinental alliance. And she was to visit Afghanistan amid news that the president would significantly drawback U.S. troops from the ground, two source with the U.S. Marines in Kabul said.

Trump is set to roll back close to half of all U.S. troops in Afghanistan, dealing a significant blow to the progress the U.S. has made over the last six months to help broker peace talks between the Afghan government and the Taliban, those same sources said. The administration appointed Zalmay Khalilzad as a U.S. envoy to Afghanistan in September to work solely on negotiations between the two sides.

Troops on the ground viewed the Pelosi trip as a chance to gain an inroad with someone, especially the highest ranking member of the House, in the U.S. government who could see the need to keep U.S. troops in the country. The announcement of the drawback has significantly lowered morale among officials and soldiers.

And Pelosi’s team, too, said it wanted a chance to visit the troops in Afghanistan—where Trump has never been—to understand exactly what was happening on the ground.

“The purpose of the trip was to express appreciation and thanks to our men and women in uniform for their service and dedication, and to obtain critical national security and intelligence briefings from those on the front lines,” Drew Hammill, spokesman for Speaker Pelosi, said.

Meanwhile, Treasury Secretary Steve Mnuchin and other Trump officials such as Secretary of State Mike Pompeo are supposed to travel to the World Economic Forum in Davos, Switzerland this week.

—With additional reporting by Asawin Suebsaeng.