For a president who at times seems to be at war with his own military leaders, it was a celebration of America’s troops that a small circle of White House aides planned carefully for weeks to prevent leaks that could scuttle the trip.

“It’s a long flight,” Trump joked after serving turkey in a cafeteria here on Thanksgiving night. “But we love it.”

Trump’s surprise three-and-a-half-hour stop marked his second visit to a combat zone and his first trip to Afghanistan, dropping into a dangerous region that cultivated the leaders of the Sept. 11 terrorist attacks.

Last year, after facing criticism for being in office nearly two years without visiting troops overseas, Trump had hinted for weeks that he would take a trip soon — “I’m going to a war zone,” he bristled when asked whether he was afraid to visit. No one was particularly surprised when an amateur British aircraft watcher tracked a Boeing VC-25A, one of the modified Boeing 747s that typically serves as Air Force One, flying over Europe.

This year, Trump said nothing publicly before leaving his family, including First Lady Melania Trump, at Mar-a-Lago for his secret visit to Afghanistan.

His staff ensured tweets would be sent from Trump’s Twitter account so Trump-watchers wouldn’t get suspicious that the normally Twitter-obsessed president wasn’t tweeting — like they did last year.

This time, 12 of the 13 journalists who traveled with Trump — representing news wires, print and broadcast outlets — were picked up on the roof of a public parking garage near Joint Base Andrews just outside Washington and not even told where they were traveling until just before they arrived in Afghanistan. Cell phones, hotspots and any other devices emitting a signal were confiscated from everyone traveling on Air Force One — yes, even the president himself.

Trump secretly slipped out of Mar-a-Lago earlier that evening and departed from an undisclosed airport on a flight a little after 7 p.m. Wednesday. The 13th journalist on the Afghanistan trip — a television correspondent — was aboard that flight and described it in a pool report as “bare-bones, except for four blue leather chairs and a moderately fancy port-a-potty that had been brought in for the occasion.”

Trump greeted the crew of that plane and even stayed in the cockpit for takeoff, the pool report said.

The presidential aircraft that Trump had flown to Florida a day earlier remained parked at Palm Beach International Airport, allowing travelers to see the modified blue-and-white 747 aircraft known around the globe as Air Force One.

That was a decoy. Secretly, a twin plane also used as Air Force One was hidden inside a cavernous hangar at Joint Base Andrews — instead of being lit up on the tarmac as usual — allowing the president to clandestinely hop on a flight without the public catching on. He departed just after 10 p.m. for the nonstop flight to Bagram Air Field, the largest U.S. base in Afghanistan.

Reporters traveling with the president learned their destination from White House press secretary Stephanie Grisham two hours before their arrival.

“It’s a dangerous area and he wants to support the troops,” Grisham said of the president. “He and Mrs. Trump recognize that there’s a lot of people far away from their families during the holidays and we thought it’d be a nice surprise.”

Asked how the president was feeling, Grisham responded: “He’s good. He’s excited.”

Air Force One landed in the dark at 8:33 p.m. local time with the shades drawn and interior lights off for security reasons — just as it had taken off from the Washington area.

Two surveillance blimps could be seen overhead. It was quiet and dark except for a smattering of lights. The base smelled of burning wood and trash.

The president moved through the sprawling base in a 15-vehicle motorcade that included tan Toyotas with soldiers standing in the truck beds holding combat rifles. Trump was followed into each location by teams of heavily armed combat troops in fatigues, helmets and night-vision goggles.

Journalists were barred from reporting on the trip until just before their departure from Afghanistan, after briefly getting internet access on the base to file. For three hours, they watched the president — in a blue suit with a red striped tie — serve turkey in a cafeteria, pose for photos and deliver remarks in a hangar to 1,500 military personnel.

For once, Trump made no mention of the troubles he’s facing at home. He didn’t discuss House Democrats pushing to impeach him in the coming weeks for pressuring Ukraine to opening politically advantageous investigations against a potential 2020 opponent. He also didn’t mention his rift with military leaders, including a new one just days before this trip.

He entered to the song that greets Trump at every rally — “God Bless the USA” — and was greeted with loud cheers and chants of, “USA! USA!” About 50 troops in fatigues stood behind him on a makeshift stage with a helicopter parked stage left.

Trump heaped praise on the troops and bragged about his accomplishments, specifically praising the work to destroy the Islamic State and al-Qaeda.

And he had a supporting actor on hand to praise the president as well — Afghanistan President Ashraf Ghani, who met with Trump on the base earlier as the president announced the resumption of peace negotiations with the Taliban.

Ghani, before a sea of troops, complimented the president for taking out leadership of the region’s major terrorist groups. “President Trump, people talk a lot about [Osama] bin Laden — but what you did to eliminate [Abu Bakr] al-Baghdadi,” he said.

“Please thank your families for agreeing to miss you on this special occasion and for being here defending United States security and our freedom,” said the Afghan president, who learned of Trump’s trip just hours before his arrival. “We will never forget what 9/11 brought us and we will never permit the repetition of 9/11 again.”

Trump told the troops stationed at Bagram that the war in Afghanistan "will not be decided on the battlefield” but by the people of the region with a political solution.

“And we will continue to work tirelessly until the day when we can bring each and every one of you home and safe to your family — and that day is coming," Trump said.

After a 13-hour journey, and a brief period on the ground, Trump also wistfully told the troops that his Thanksgiving meal had been cut short. “I sat down, I had a gorgeous piece of turkey and I was all set to go. And I had some mashed potatoes and I had a bite of mashed potatoes, and I never got to the turkey, because Gen. [Mark] Milley said come on over, sir, let’s take some pictures. I never got to my turkey. It’s the first time at Thanksgiving that I’ve never had anything called turkey.“

Soon after, Trump hopped back onto his plane for another long flight back to Mar-a-Lago, where he usually spends Thanksgiving Day.