In Puerto Rico, the governor’s orders specifically mentioned the shuttering of bars, shopping malls and movie theaters, all gathering places that had appeared packed on Saturday. The Latin trap artist Bad Bunny disappointed some fans on social media after he posted a selfie of himself tightly hugging friends.

On Sunday, hours before the shutdown order was to take effect at 6 p.m., San Juan, the capital, bustled as usual. The crowds at Plaza Las Américas, the biggest shopping mall, seemed perhaps a bit thinner. The island’s schools had already been ordered closed for the next two weeks.

Cellphones buzzed in unison on Sunday afternoon with the sound of an emergency alert about the curfew.

“It seems like a pretty logical and fair measure to take at night,” one resident, Alexander Caraballo, said of the curfew after standing in a short line on Sunday at a homeopathic pharmacy in the town of Manatí to stock up on vitamin C and echinacea. The shop was letting customers in one at a time to avoid needless contact.

“I’ve personally been isolating myself, and taking preventive measures, and being disciplined to avoid contagion,” said Mr. Caraballo, 25, a freelance fashion and portrait photographer. At the supermarket, cashiers wore gloves, he said. “I’ve run into several acquaintances, worried but getting ready.”

Five coronavirus cases have been confirmed in Puerto Rico so far, though more are suspected. Ms. Vázquez, who assumed the governorship in August and is now running for the seat, appeared determined to avoid a deadly disaster similar to Hurricane Maria in 2017, which killed an estimated 2,975 Puerto Ricans. Her administration has already been criticized for getting slow Covid-19 test results from the Centers for Disease Control and Prevention in Atlanta. Rafael Rodríguez Mercado, the health secretary, resigned on Friday.

One-fifth of Puerto Rico’s population of nearly 3.2 million is 65 or older, and the island’s health system struggled after Hurricane Maria. Puerto Rico has also been dealing with the aftermath of earthquakes that sent thousands of fearful people to sleep outdoors.