They grabbed milk and aspirin, paper towels and spaghetti. Cans of soup and bottles of laundry detergent. Olive oil and sanitizing wipes. With futures suddenly thrust into the unknown, they did what felt reassuring: panic shop.

As President Trump declared a national emergency on Friday, hordes of shoppers flooded stores across the nation and emptied shelves, looking to stockpile groceries and household items to prepare for uncharted territory.

Inside the Target at Atlantic Terminal in Brooklyn, customers snatched up hand soap, lotion, condoms, vitamins and tampons. Cold and flu medicines were completely sold out. One customer, Jason Krigsfeld, 31, was relieved to find a 20-pack of Charmin toilet paper — the last one on the shelf. He and his wife had already collected hand soap, laundry detergent and floor cleaner.

“We saw people emergency shopping yesterday and were like, ‘We need to do that, too,’” said Mr. Krigsfeld, who works in software.