President Donald J. Trump on Friday thanked the U.S. Coast Guard, first responders and Louisiana Gov. Jeff Landry after a tanker slammed into a docked river cruise ship on the Mississippi River in New Orleans, an accident in which every person aboard was accounted for.

“Thank you to the United States Coast Guard for doing such an incredible job of rescue, and other work, having to do with the crash of the two ships in Louisiana,” the president wrote on Truth Social. “Likewise, all of Law Enforcement and First Responders were fantastic! Incredibly, nobody was killed by this major collision. 32 people are in the hospital. Thank you to Governor Jeff Landry for your outstanding leadership during this very agonizing period of time.”

The tanker Atlantic Asphalt struck American Cruise Lines’ American Heritage at about 12:30 p.m. local time near the Crescent City Connection, as passengers were beginning to disembark, according to the Port of New Orleans. Port officials initially reported about 129 passengers aboard, in addition to crew. The cruise ship took on water and capsized, leaving some people in the river.

Officials said 32 people were taken to hospitals, none with critical injuries, including two Harbor Police officers who went into the water during the rescue. No one aboard the tanker was hurt.

“This is a miracle,” Mr. Landry said at a news conference. “The Mississippi River is not some quiet pond, right? I mean, there were challenges out there.” He added, “We got everybody.”

The governor said the state would find out what went wrong. “Our Mississippi River in Louisiana has operated with impeccable safety for a very long time,” he said. “We are going to get down to the bottom of exactly what happened here and make sure that we make any adjustments necessary so that the people that travel on the waterways here can know that they can do so in safety.”

Coast Guard Capt. Melanie Burnham said the search-and-rescue operation had ended and that investigators were examining an apparent loss of steering on the tanker, though the cause had not been determined. The Coast Guard closed the river to vessel traffic between mile markers 93 and 96. “We’re going to get the river open as soon as possible so we can keep commerce flowing,” Ms. Burnham said.