MOBILE, Ala. — A cruise ship disabled for five nightmarish days in the Gulf of Mexico finally docked with some 4,200 people aboard late Thursday, passengers raucously cheering the end to an ocean odyssey they say was marked by overflowing toilets, food shortages and foul odors.

“Sweet Home Alabama!” read one of the homemade signs passengers affixed alongside the 14-story ship as many celebrated at deck rails lining several levels of the stricken ship Triumph. The ship’s horn loudly blasted several times on its final docking approach as some gave a thumbs-up sign and flashes from cameras and cellphones lit the night.

About an hour after the ship pulled up at 9:15 p.m. Central, a steady stream of passengers began making their way down the glass-enclosed gang plank, some in wheelchairs and others pulling carry-on luggage. One man gave the thumbs up.

An ambulance pulled up to a gate at the bottom of the gang plank and then its lights went on and it pulled away.

For 24-year-old Brittany Ferguson of Texas, not knowing how long passengers had to endure their time aboard was the worst part.

“I’m feeling awesome just to see land and buildings,” said Ferguson, who was in a white robe given to her aboard. “The scariest part was just not knowing when we’d get back”

As the ship pulled up, some aboard shouted, “Hello, Mobile!” Some danced in celebration on one of the balconies. “Happy V-Day” read one of the homemade signs made for the Valentine’s Day arrival and another, more starkly: “The ship’s afloat, so is the sewage.”

A few dozen relatives on the top floor of the parking deck of the terminal were waving lights at the ship as it carefully made its way alongside. Those about were screaming, whistling and taking pictures.

Hundreds gawked from dockside at the arrival at the Alabama cruise terminal in Mobile, the state’s only seaport, as the Triumph docked.

Taxis were lined up waiting for people, and motorists on Interstate 10 stopped to watch the exodus of passengers from the cruise ship.

Some still aboard chanted, “Let me off, let me off!”

It took six grueling hours navigating the 30-odd-mile ship channel to dock, guided by at least four towboats. Nearly 900 feet in length, it was the largest cruise ship ever to dock at Mobile.

It was expected to take up to five hours for all 3,000 passengers to disembark and a steady stream were making their way down the gangplank early Friday morning.

Carnival said all passengers had the option of a seven-hour bus ride to the Texas cities of Galveston or Houston or a two-hour trip to New Orleans. Some also could stay in Mobile.

Up to 100 buses were standing by. Galveston is the home port of the ill-fated ship, which lost power in an engine-room fire Sunday some 150 miles off Mexico’s Yucatan peninsula.

It was the end of a cruise that wasn’t anything like what a brochure might describe.

Carnival CEO Gerry Cahill apologized at a news conference and later on the public address system as people were disembarking. “I appreciate the patience of our guests and their ability to cope with the situation. And I’d like to reiterate the apology I made earlier. I know the conditions on board were very poor,” he said. “We pride ourselves on providing our guests with a great vacation experience, and clearly we failed in this particular case.”