(CNN) -- It was Sunday morning that a fire broke out in the engine room on the Carnival Triumph, leaving the ship adrift in the Gulf of Mexico.
The vessel eased into port Thursday night.
Why did it take five days to rescue the 3,143 passengers and 1,086 crew members on board?
The answer is not simple.
It involves a handful of big decisions and some environmental factors outside anyone's control.
Here are three reasons why the process has taken as long as it has:
1. Carnival Cruise Lines decided to tow the ship back to port.
Citing safety concerns, the company opted to tow the ship, rather than move passengers to another vessel.
"We evaluated a wide range of options including using another ship to transport guests, but the safest solution was towing the ship back to port. We have a huge team involving multiple departments working around the clock to get our guests home as quickly as possible," Carnival said on its Facebook page.
Spokesman Vance Gulliksen elaborated in an e-mail.
"Regarding why we didn't use another cruise ship, we checked on this and all of our ships are in service right now, meaning that there aren't enough cabins available to accommodate more than 3,100 guests who are currently on the Triumph. Additionally, a ship-to-ship transfer at sea would be considered too risky," he said.
2. Strong currents pushed the ship north, prompting the company to change where the Carnival Triumph would dock.
After deciding the ship had to be towed, the cruise company chose as its destination the closest port, which was then Progreso, Mexico.
But soon after the decision was made, and before tugboats could take control, strong currents nudged the ship some 90 miles north, putting it nearly as close to Mobile, Alabama, as to Progreso.
"Given the strength of the currents, it is preferable to head north to Mobile, rather than attempt to tow against them," the company said on its Facebook page.
The U.S. port had another advantage.
It provided easier re-entry for passengers and crew, particularly for the roughly 900 guests on board traveling without passports, Carnival said.
3. The sheer size of the task is staggering.
The Carnival Triumph is a beast of a ship. It is 14 stories, nearly 900 feet long and is carrying more than 4,000 people.
Moving it anywhere takes a tremendous amount of time, energy and calculation.
It traveled up a channel Thursday toward Mobile, a process that typically takes two to three hours.
But because tugboats go slower than ships sailing at their normal speeds, that same trip was expected to take seven to 10 hours, said Gulliksen, the Carnival spokesman.
The journey was further delayed for four hours when the towline from the lead tugboat to the ship snapped, and another tug pushing the ship broke a bit.
Even once the ship docked, Carnival officials said it would take four to five hours to get everyone off, which will likely seem like an eternity to those waiting to see loved ones.
"We have to clear all of the decks, section by section, with first priority to guests with special needs and children," said Gulliksen.
"The entire process is quite involved, given that there are more than 3,100 passengers and nearly 1,100 crew, and this is compounded by the ship only operating on emergency power," he said.