Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

CIVITAVECCHIA, Italy — Thousands of passengers, including more than 100 Americans, were stuck on their Italian cruise ship for much of Thursday after a passenger showed symptoms of the coronavirus, officials said.

But by late Thursday night, all 6,000 passengers and 1,000 crew had been given the medical OK to come and go from the Costa Smeralda, officials said.

Earlier in the day, the cruise line operator announced that everyone had to stay on board after one traveler appeared to fall ill.

It turns out the sickened female guest, a 54-year-old Chinese national, was "diagnosed ... with the common flu," according to a statement Thursday night from Costa Crociere.

"While we appreciate the inconvenience caused, the procedures in force and our cooperation with the Health Authorities were effective in managing this situation and were intended to ensure maximum safety for all our guests, crew and the community as a whole," the cruise company statement said.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Of those travelers, 114 are American, cruise line spokesman Davide Barbano said.

The ship has 1,143 passengers who were scheduled Thursday to end their cruise in Civitavecchia, a port city about 50 miles northwest of Rome.

Health officials with the maritime authority in Civitavecchia had given those travelers permission to leave the ship earlier in the day — but that city's mayor asked for that disembarkment to be delayed until the results of all medical tests were known.

The maritime authority agreed to that delay, according to Patrick Vignola, a spokesman for the mayor.

“The mayor himself does not have the authority to overrule decisions by the port authority," Vignola told NBC News earlier on Thursday.

"Nevertheless, once we learned that more than a thousand passengers were going to be allowed to disembark, he sent a request to the health ministry, the port authority and health authority to keep all passengers on board until the result of the tests clears the suspicion of coronavirus."

Vignola added: "He did that because as a mayor he is responsible for the well-being of his citizens, and worried port workers were asking him, `How do we know we are safe?' We are glad the authorities listened to our plea.”

Then hours later, the entire ship was cleared.

More than 7,800 people in China have been infected by the virus that emerged in the central city of Wuhan. China has reported 170 deaths.

Claudio Lavanga reported from Rome and Civitavecchia, and David K. Li from New York