In a battle of snubs, President Trump outbid House Speaker Nancy Pelosi on Thursday, canceling her plans to use an Air Force jet to lead a delegation of lawmakers on a trip to Brussels and Afghanistan.

The move was apparent retaliation for Mrs. Pelosi’s attempt to postpone Mr. Trump’s State of the Union address — though the White House said the goal was to keep Mrs. Pelosi in town, where she might finally enter into negotiations over border wall funding and the now 4-week-old partial government shutdown.

Outraged Democrats said the president hit a new low by canceling Mrs. Pelosi’s plane and creating a security nightmare by alerting America’s enemies of Mrs. Pelosi’s plans to travel to a war-torn country.

“In light of the 800,000 great American workers not receiving pay, I am sure you would agree that postponing this public relations event is totally appropriate,” Mr. Trump wrote in a letter to the California Democrat.

Still, he insisted that Mrs. Pelosi could still make the trip — if she was willing to fly commercial. “That would certainly be your prerogative,” he wrote.

That seemed unlikely given that the president had divulged her travel plans to war-torn Afghanistan, which Democrats said was a major mistake.

Rep. Adam B. Schiff, California Democrat and chairman of the House Permanent Select Committee on Intelligence, also was scheduled to be on the trip. He said the disclosure was “utterly irresponsible in every way.”

Drew Hammill, Mrs. Pelosi’s deputy chief of staff, said Mrs. Pelosi was leading a congressional delegation, or CODEL in Capitol-speak, to thank U.S. troops in Afghanistan and to hear “critical” security and intelligence briefings from the front lines in the war on terror. He disputed Mr. Trump’s assertion that the trip was to touch down in Egypt but said it was to make a stop in Brussels for meetings with NATO officials.

Mr. Hammill also said it was to be a “weekend visit,” not the seven days that the president asserted.

Some of the lawmakers scheduled to go on the trip learned of Mr. Trump’s decision while sitting on an Air Force bus outside the Capitol, ready to leave for Joint Base Andrews. That base is the home of the 89th Air Wing, which runs Air Force One and a separate fleet of jets for executive travel by top civilian leaders.

One Democrat said they could find no precedent for a president canceling a government jet for members of Congress, though documents dating back to the 1990s show final decisions on use of the aircraft do rest with the White House.

Mr. Hammill said the decision smacked of hypocrisy after Mr. Trump traveled to the southwestern border and to New Orleans this month, and flew last month for a post-Christmas visit to troops in Iraq days after the shutdown began.

He also chided the president for allowing Cabinet members to fly later this month to a glitzy economic summit in Davos, Switzerland.

Those gibes appeared to strike home. By evening, Mr. Trump had stopped the Davos delegation.

A White House official said that “all ‘CODELs’ have been canceled.”

Mrs. Pelosi also uses a government plane to travel back and forth to her district in San Francisco, but such travel isn’t considered a CODEL.

White House officials said they hoped Mrs. Pelosi would stay in town and work on an agreement to end the shutdown, which is about to cost some 800,000 government workers a second paycheck. They’ll all be paid when the shutdown ends — even those who aren’t doing any work — but for now it means struggles paying bills, workers say.

Mrs. Pelosi said she is willing to negotiate but won’t allocate any money for Mr. Trump’s border wall plans. She also said their face-to-face meeting last week was a “setup” for the president to walk out.

While more voters blame Mr. Trump for the shutdown and oppose his border wall plans, they don’t seem to be feeling any pain from the shutdown. Four in 5 Americans surveyed for an ABC/Washington Post poll this weekend said they haven’t been affected, and only about a third said it would be a crisis if the shutdown dragged on for months.

Mrs. Pelosi tried to raise the stakes this week with her letter to Mr. Trump advising him to postpone the Jan. 29 State of the Union address.

She said in her original letter that she feared for “security” because the Homeland Security Department, which oversees the Secret Service, is one of the agencies that is operating under a shutdown.

But Congress, which traditionally hosts the speech, is fully funded, and the homeland security secretary said the Secret Service is “fully prepared” for the event.

Given that rebuttal, Mrs. Pelosi shifted her explanation Thursday, saying she wasn’t worried about security as much as she didn’t like the symbolism of Secret Service agents working without pay.

“It isn’t a question of ‘Are they professional enough?’” she told reporters. “The question is they should be paid.”

Mrs. Pelosi’s letter Wednesday merely suggested postponing the speech, though her top deputy, House Majority Leader Steny H. Hoyer, Maryland Democrat, told CNN that it “was off.” Mrs. Pelosi said Thursday that she hasn’t decided what she will do if Mr. Trump keeps to the current schedule.

Some Republican lawmakers suggested that the president deliver his speech in the smaller Senate chamber. They said overcrowding shouldn’t be an issue, given that many angry Democrats likely would skip the address.

They also pointed out that George Washington delivered the first State of the Union address to the Senate chamber, which at the time was in New York.

Sen. Lindsey Graham, South Carolina Republican, said both Mr. Trump and Mrs. Pelosi got it wrong this week.

“One sophomoric response does not deserve another,” he said. “Speaker Pelosi’s threat to cancel the State of the Union is very irresponsible and blatantly political. President Trump denying Speaker Pelosi military travel to visit our troops in Afghanistan, our allies in Egypt and NATO is also inappropriate.”

Democrats said Mrs. Pelosi was right to try to postpone Mr. Trump’s speech but the president was wrong in clapping her back.

“It’s petty. It’s small. It’s vindictive. It’s unbecoming of a president of the United States. But it is unfortunately a daily occurrence,” Mr. Hoyer said.

Sen. Marco Rubio, Florida Republican, marveled at where things were heading: “Welcome to 2019. I think it’s going to get crazier.”

• S.A. Miller and Gabriella Muñoz contributed to this report.