The guidance signaled another escalation in the Trump administration’s efforts to ward off the fast-growing spread of the virus, and another instance of what appeared to be separation between health officials and the president, who has repeatedly registered skepticism over making statements he believes are alarmist.

It came as federal and state officials scrambled to contain a cluster of cases on the 3,500-passenger Grand Princess, which has idled off the coast of California. Twenty-one people onboard tested positive for the coronavirus, and it was on its way to dock on Monday at the Port of Oakland, the vessel’s operator said.

The decision to caution Americans capped weeks of discussions on the Trump administration’s interagency task force about how to communicate alarm about cruise ships after hundreds of Americans, including some who tested positive for the virus, were evacuated from the Diamond Princess off the coast of Japan, a process rife with confusion and disorder.

It was Vice President Mike Pence, who is overseeing the federal government’s coronavirus efforts, who signed off on the State Department’s announcement and Stephen E. Biegun, the deputy secretary of state and another task force member, who formalized it, a senior official familiar with the decision said. The final call on Sunday did not reach Mr. Trump’s level, the official said.

The White House did not immediately respond to an email seeking comment.

The State Department guidance came a day after Mr. Pence held a meeting with cruise ship industry officials about what, if anything, the federal government might do. Some executives were surprised to see the department’s warning after it emerged. One senior administration official familiar with what was said at the meeting said industry officials seemed to be looking for the federal government to take action as opposed to cruise ship companies instituting their own more rigorous policies.