ISTANBUL — Turkey’s powerful interior minister said Sunday that he was resigning, two days after his ministry’s apparently bungled announcement of a weekend curfew sent a flood of people rushing to stores during the coronavirus outbreak.

The minister, Suleyman Soylu, wrote on Twitter Sunday that the round-the-clock curfew, imposed in dozens of cities late Friday, “was aimed entirely at preventing the epidemic.” But it was poorly executed, by almost every account.

The public was given two hours’ notice before the curfew started, so crowds quickly formed outside bakeries, supermarkets and corner stores, exposing untold numbers of people to danger. And the mayor of Istanbul, Turkey’s largest city, said he was not notified of the curfew in advance.

A few hours after Soylu offered his resignation, President Recep Tayyip Erdogan rejected it. “He will continue to serve his position,” said a statement from the office of the presidency released Sunday.

Images of panicked shoppers were widely shared on social media, embarrassing Erdogan’s government as officials struggle to contain one of the most rapidly accelerating coronavirus outbreaks in the world. More than 55,000 people in Turkey have tested positive for the virus, and 1,198 have died, according to Sunday’s Health Ministry figures.

The Turkish leader had for weeks resisted calls to impose lockdowns in Turkey’s largest cities in order to keep the economy running. The weekend curfew, which reduced Istanbul’s roar to a whisper, was among the first signs that his government was considering far stricter measures to bring the outbreak under control.