But there are pitfalls. In Spain, it was the military that discovered that patients in a nursing home had been abandoned amid the pandemic. But that led to a spitting match between the country’s minister of defense, who criticized health workers for leaving their posts, and the union representing those workers, who said they had not been given enough equipment by the government.

In Liberia, during the 2014 Ebola crisis, the president deployed the country’s military to enforce a sudden, mandatory quarantine of a densely populated slum, with disastrous results: Protests broke out, and soldiers fired live rounds into the crowd. A 15-year-old was shot and killed.

The American military is recognized as a formidable fighting force, with logistical, communications and supply networks that excel in extremis. The people now calling on the military to help think more can and should be done, as a number of governors, mayors and municipal officials in besieged cities across the United States have made television appearances to plead for aid from the Defense Department.

“The military has extraordinary medical capacity of its own that’s been honed in fighting wars,” Mayor Bill de Blasio of New York told NBC’s “Meet the Press” on Sunday. “They can handle any situation. All that great personnel who are medically trained should be sent to places where this crisis is deep, like New York, right now.”

In particular, the armed services know how to set up command-and-control centers, how to stock warehouses and how to transport doctors, nurses and medical materials around the country, and quickly.

Gen. Mark A. Milley, the country’s top military officer, said on Monday that two Army field hospitals would arrive in New York and Seattle by Thursday, bringing to each city the ability to care for an additional 248 patients. The hospitals, one to each city, will have 11 ventilators each.

Other mobile combat hospitals are prepared to deploy and may soon be headed to stricken areas, General Milley said. The Mercy, the Navy hospital ship based in San Diego, is bound for Los Angeles with its 1,000 beds.