(CNN) A pair of cruise ships carrying passengers with flu-like symptoms docked in Florida's Port Everglades on Thursday evening, ending a nightmarish voyage disrupted by the coronavirus pandemic.

An agreement between the cruise line and local and federal authorities will allow healthy passengers to go home while the sick remain on board for treatment, according to Broward County officials.

After days of uncertainty over their final destination, the Zaandam and Rotterdam cruise ships will have passengers disembark Thursday night at the Fort Lauderdale port, Broward County Commissioner Barbara Sharief said Thursday.

Fort Lauderdale Mayor Dean Trantalis sought to allay community concerns over the possible spread of the virus.

"Holland America agreed to a strict set set of protocols if the county decided to allow the ships to dock," he said via Twitter Thursday afternoon, referring to the agreement involving the cruise line, U.S. Coast Guard, Homeland Security, state and federal health officials and Broward County.

"Given the county's decision to allow the ships here, I believe these regulations present a humanitarian solution for those on board while providing strong safeguards for our community," the mayor said.

The Zaandam's South American itinerary changed dramatically when nine passengers tested positive for Covid-19 and four men died on board. Sharief said the men were over the age of 70 -- two had been diagnosed with Covid-19, one suffered a heart attack and another succumbed to a preexisting illness.

Broward County Mayor Dale Holness told reporters that 26 passengers with possible coronovirus symptoms will remain on the ships. Additionally, 13 passengers and one crew member will be treated at a local hospital. At one time more than 200 guests and crew had flu-like symptoms.

Holness said about 1,200 guests "deemed well and fit to travel," per CDC guidelines, will be given masks and transported by private buses directly to the tarmac at Fort Lauderdale International Airport for five charter flights home Friday night and Saturday. They will undergo two layers of health screening.

Nearly 40 Florida residents will receive transportation to their home and be required to self quarantine for 14 days, Holness said.

"Our top consideration is the health of our community as well as those on board," he said. "It shows the good side of Broward County."

Holland America said late Wednesday that it had secured a local health system to treat the fewer than 10 people in need of immediate critical care onshore. The Broward Health Hospital System confirmed Thursday that critically ill patients from the Zaandam would be transferred there, according to spokeswoman Jennifer Smith.

"Prepare to disembark" was the long-awaited, reassuring message delivered to passengers by the captain of the Rotterdam, the Zaandam's sister ship, on Thursday morning, according to passenger Laura Gabaroni.

Some 200 passengers hail from countries requiring connecting flights to get home, Sharief said.

Passengers on the Zaandam include 311 US citizens from 46 states, including 52 Floridians. Broward residents among them have agreed to isolate for an additional 14 days at home. The rest from from countries ranging from Canada to the UK to Australia.

Broward County Commissioner Michael Udine Thursday expressed frustration that the decision over the ships' final port was left mostly in the hand of local officials. He said he had to field calls from consul generals from other countries in the past few days.

On Wednesday night, the British-American cruise line called the plight of those on board a "humanitarian situation." It made a last-ditch appeal to federal and local authorities to allow the cruise ships to disembark in the Port of Everglades.

"Holland America Line calls for compassion and reason in the review and approval of our disembarkation plan by Florida officials," the cruise line said in a statement.

The appeal came hours after Gov. Ron DeSantis said his state was willing to accept Floridians on board the cruise ships.

There are 808 guests and 583 crew on the Rotterdam and 442 guests and 603 crew on the Zaandam, according to Holland America.

DeSantis expressed concerns about taking in others given the state's limited hospital beds.

'They need to get to land'

The Zaandam began transiting the Panama Canal late Sunday after being docked off Panama for several days. The boat and its occupants have been in limbo for weeks awaiting permission to disembark after several South American ports denied the ship's entry.

The US Coast Guard, in a marine safety information bulletin issued Sunday, said an increase in foreign passenger vessels requiring medical evacuations was straining local medical resources.

Passengers have "better access to comfortable surroundings and medical staff on board the foreign passenger vessel where care is already being provided," according to the bulletin.

Holland America's Zaandam cruise ship, with sick passengers and crew members on board, seeks a port to dock.

Jennifer Allan said her mother, Gloria Weed, 70, and father, Bill Weed, 75, have been quarantined in their cabin aboard the Zaandam in what she described as "solitary confinement."

"My dad has developed pneumonia," she told CNN this week. "He's getting worse. They need to get to land. They need to get medical attention sooner rather than later."

Allan said her parents, who live in Sarasota, Florida, came down with a fever about 10 days ago. She described the efforts of the Zaandam crew members to care for passengers as "extraordinary" even though many are themselves sick.

No one has left the ship since it stopped in Punta Arenas, Chile, on March 14. Guests were originally told they could disembark in Chile for flights, but ultimately that was forbidden.

Holland America deployed the Rotterdam to offer relief. Rotterdam met Zaandam off Panama on March 26 to "provide extra supplies, staff, Covid-19 test kits and other support as needed."

Holland America transferred healthy Zaandam guests to Rotterdam.