The State Department said Americans who were in China should consider leaving via commercial transportation. It also requested that all nonessential United States government personnel hold off on traveling to China.

In China, at least 213 people had died from the virus as of early Friday, the authorities said. The total number of cases worldwide was approaching 10,000, according to Chinese and World Health Organization data. The vast majority of cases were in China.

The warning by the State Department came on the same day that the first person-to-person transmission of the coronavirus in the United States was reported. An Illinois man had contracted the virus from his wife, who had recently visited Wuhan, China, the epicenter of the virus. Both were hospitalized.

Also on Thursday, the union for 15,000 American Airlines pilots filed a lawsuit in Dallas County Court in Texas seeking a temporary restraining order to suspend flights to China. The union, the Allied Pilots Association, said that British Airways, Air Canada and Lufthansa had already suspended service to China.