WASHINGTON — House Speaker Nancy Pelosi on Friday accused White House officials of leaking her plans to travel to Afghanistan via commercial airlines, thwarting her efforts to visit troops in the war zone for the second time this week.

Administration officials have denied the charge.

Pelosi’s accusation came a day after President Donald Trump announced he would revoke access to military aircraft for a delegation of Democratic lawmakers to travel to the combat zone because of the ongoing government shutdown.

In a letter criticizing the pre-planned but unannounced trip as a “public relations event,” Trump said he thought “it would be better if you were in Washington negotiating with me and joining the Strong Border Security movement to end the Shutdown.”

But he also said Pelosi was welcome to travel commercial and complete the trip if she wanted.

Pelosi’s staff said Friday that she and the congressional delegation tried to do that, only to have those plans also upended by Trump.

“In the middle of the night, the State Department’s Diplomatic Security Service provided an updated threat assessment detailing that the president announcing this sensitive travel had significantly increased the danger to the delegation and to the troops, security, and other officials supporting the trip,” said Drew Hammill, spokesman for Pelosi. “This morning, we learned that the administration had leaked the commercial travel plans as well.”

As speaker of the House, Pelosi is second in the line of succession to the presidency, behind only Vice President Mike Pence.

Hammill said the decision was made to postpone the trip “so as not to further endanger our troops and security personnel, or the other travelers on the flights.”

Democrats involved in the trip had said their goal was to thank troops for their service overseas and learn about the situation on the ground in Afghanistan.

White House officials on Friday announced that all congressional travel on military or other federally owned aircraft will be suspended during the ongoing government shutdown, unless approved by the White House chief of staff.

The move to block the congressional visit is highly unusual, given past support from both parties for the trips.

Last March, Pelosi lead a similar congressional delegation to Jordan, Israel and Afghanistan with 11 other House lawmakers. Former House Speaker Paul Ryan and then-House Armed Services Committee Chairman Mac Thornberry arranged a similar trip to visit troops in Afghanistan in October.

Trump’s decision came just days after Pelosi suggested delaying or canceling the annual State of the Union address set for later this month because of the ongoing shutdown, now nearly a month old.

Pelosi said that some of the agencies involved with security for the national address — including the Secret Service — are working on short staff and without pay, complicating plans for the event. White House officials have dismissed those concerns.

The shutdown began on Dec. 22 after congressional Democrats and Trump were unable to reach a deal on White House demands for more than $5 billion in funding for his controversial southern border wall project.

Trump visited U.S. troops overseas in Iraq a few days after the shutdown began, leading to charges of hypocrisy from the Democrats whose trip was canceled this week. Trump has not yet visited Afghanistan.

White House officials have discussed a possible drawdown of U.S. forces in the country, but so far have made no public announcements on moves. Pentagon officials have said that American troops have made progress training local forces in recent years and rapid withdrawal could destabilize the region.

On Thursday, an Army sergeant died in Landstuhl, Germany, four days after he was shot by insurgents during a reconnaissance mission in Afghanistan, the 10th American casualty there in the last four months.