FORT LAUDERDALE, Fla. — A cruise ship where at least two passengers died of coronavirus while barred from South American ports finally docked Thursday in Florida after two weeks at sea and days of negotiations with initially resistant local officials.

The Zaandam and a sister ship sent to help it, the Rotterdam, were allowed to unload passengers at Port Everglades after working out a detailed agreement with officials who feared it would divert needed resources from a region that has seen a spike in virus cases.

Broward County officials and Holland America, the company that operates the ships, announced the agreement shortly before the ships pulled into port.

Holland America initially said 45 people who were mildly ill would stay on board until they recovered, but the docking plan released later Thursday indicated that 26 passengers and 50 crew members were ill. The plan noted that the company had secured access at two local hospitals for 13 passengers and a crew member who needed medical care.

For nearly three weeks, passengers have not been able to step on dry land. Four elderly passengers died on the Zaandam, at least two from COVID-19, said William Burke, chief maritime officer for Carnival Corp., which owns the ships. Nine people had tested positive for the new coronavirus, Burke said earlier this week.

There were 442 guests and 603 crew on the Zaandam, and 808 guests and 583 crew on the Rotterdam. The Rotterdam was sent last week to take in some of the passengers and provide assistance to the Zaandam since it was denied permission to dock at ports in South America.

About 250 people have reported influenza-like symptoms since March 22, including 17 aboard the Rotterdam, according to the docking plan.

Originally firmly opposed to the ships' arrival, Florida Gov. Ron DeSantis said Wednesday that he had a change of heart after realizing many passengers were U.S. citizens and about 50 of them Floridians.

He went further on Thursday, telling Fox News that allowing the ships to dock and transferring critically ill patients to hospitals was "the humanitarian thing to do."

"I think the accommodations have been made, and I think that things are going to be done very thoughtfully," he said later at a news conference. "It's going to be a very controlled exit from these ships."

The docking plan indicated that Florida residents would leave the ship first, with the disembarkation of all passengers not concluding until Friday night.

Passengers who have no symptoms of the virus will be bused to airports and put directly on charter flights without passing through the terminals, DeSantis said.

Emily Spindler Brazell, of Tappahannock, Virginia, was still in her cabin waiting for instructions from the Rotterdam's captain but said she was relieved to be back home.

"People greeted us, came out to their balconies, blew air horns and shouted, 'Welcome home!'" she said. "It was surprising. We went to many countries that said, 'We are not going to talk to you.'"

Passenger Laura Gabaroni, of Orlando, said she would not be comfortable until she disembarked. She was transferred to the Rotterdam last Saturday, along with husband Juan Huergo and other passengers not showing signs of illness.

"Many broken promises so far, so I'll believe it when I see it," she told The Associated Press via a WhatsApp message.