An upbeat President Trump said Tuesday that hurricane-ravaged Puerto Rico was lucky it hadn’t faced “a real catastrophe, like Katrina,” which could have caused even more death and destruction.

“Every death is a horror. But if you look at a real catastrophe, like Katrina, and you look at the tremendous hundreds and hundreds and hundreds of people that died, and you look at what happened here,” Trump said at a briefing in San Juan with Puerto Rican officials, Cabinet members and military brass.

“What is your death count as of this moment? Seventeen? Sixteen people certified, 16 people versus in the thousands.”

Katrina struck the Gulf Coast in 2005 and led to the deaths of more than 1,800 people. The death toll in Puerto Rico is at least 34.

Trump lavished praise on his team, hailing FEMA Director Brock Long, acting National Security Administration secretary Elaine Duke, Homeland Security chief Tom Bossert, and Lt. General Jeff Buchanan, who is overseeing rescue operations.

“Brock has been unbelievable. This is a Category 5 [hurricane] which few people have ever heard of. It hit land and, boy did it hit land,” Trump said during his first visit as president to the US territory, two weeks after Hurricane Maria devastated much of the island. “Elaine has been incredible. Tom Bossert, here someplace. Great job . . . The whole team has been amazing.”

He cracked a joke about the money needed to rebuild while referring to Budget Director Mick Mulvaney.

“Mick is in charge of a thing called budget,” he said. “I hate to tell you, Puerto Rico, but you are throwing our budget out of whack. We spent a lot of money on Puerto Rico, and that’s fine. We saved a lot of lives.”

The president’s overriding message was that his administration had done a bang-up job — even though conditions on the ground remained dire, with many still without power, shelter and drinking water.

Trump applauded Puerto Rican Rep. Jenniffer González-Colón for “saying nice things” about the federal government’s efforts. And he commended Democratic Gov. Ricardo Rosselló — even though “he is not even from my party.”

“He was giving us the highest grades,” Trump said.

But after shaking hands when he arrived, he ignored San Juan Mayor Carmen Yulín Cruz — whom he has slammed after she said the feds weren’t moving fast enough.

The president, in a navy windbreaker and khaki slacks, and first lady Melania Trump, in a ball cap, shades and dark-green jacket, emerged from Air Force One at a National Guard airport shortly before noon.

After the briefing, they took a walking tour in the town of Guaynabo and posed for selfies with a welcoming crowd.

“Thank you for being here, it’s so good to see you,” one man said to the group, speaking in Spanish.

At the town’s Calvary Chapel, signs reading “Proud Americans,” “Let’s Make Puerto Rico Great Again” and “God bless You Mr. President” greeted Trump.

“There’s a lot of love in this room, a lot of love,” Trump said before handing out bags of rice and tossing rolls of paper towels into the crowd.

He later took a chopper to the USS Kearsarge aircraft carrier, where he met with officials from the US Virgin Islands.

With Wires