TAIPEI, Taiwan — For most of the past year, it was as though the pandemic didn't exist in Taiwan. Restaurants and bars remained crowded. Reservations were hard to come by. Large events including music festivals and marathons went ahead, while domestic tourism boomed. In April, as many as 4 million people crowded the streets in central Taiwan for a nine-day pilgrimage.

Life was so normal that when the government began offering the Oxford-AstraZeneca coronavirus vaccine to certain groups in late March, few saw the need to get inoculated. Worried the unused doses would go to waste, authorities opened access to the general public for a fee.

Now, Taiwan faces its worst outbreak of the pandemic, with more than 1,000 new local infections in 10 days. Residents, suddenly eager to be vaccinated, are being turned away as authorities ration a supply of about 300,000 vaccine doses for a population of 24 million.

“We were so isolated that when other places were suffering, we didn’t think about what we would do if this happened to us,” said Vic Chiang, 28, a freelance writer in New Taipei City, one of two cities now under the second-highest coronavirus alert level. Chiang, who previously felt it was not urgent to get vaccinated, has missed his chance for now.

For much of the past year, Taiwan has been held up as an example of how to contain the coronavirus without resorting to extreme measures. Strict border control and a public quick to wear masks and take precautions after the experience of the 2003 SARS epidemic have meant that Taiwan recorded a little more than 2,000 cases and 14 deaths.

Now, fortunes seem to have reversed. As other countries embark on mass vaccination drives, only about 1 percent of Taiwan’s population has been vaccinated. Critics and anxious residents say officials squandered an opportunity to get ahead of the pandemic.

“Everything was stable for such a long time. We didn’t take the opportunity to do things like speed up the rollout of vaccines or increase testing capacity,” Chiang said.

The current outbreak began in April, with one cluster of cases connected to the Novotel in Taoyuan, used as a quarantine center for aviation staff. In early May, three other clusters emerged in Taipei’s Wanhua district, connected to hostess bars and teahouses, as well as in New Taipei City and in Yilan County in northeastern Taiwan. Health officials said the three clusters share the same genetic sequences of the cases in Taoyuan, which suggests a chain of transmission. On Tuesday, officials reported 240 local cases and two new deaths.

“Taiwan was too proud to admit there was community transmission, which started from the hotel cluster and other cases of family gatherings,” said Wang Jen-Hsien, chairman of the Taiwan Counter Contagious Disease Society.

Wang said Taiwan health authorities have focused their efforts at the border, relying on quarantine measures as the main method of preventing contagion.

“Because Taiwan did not really experience a large-scale spread of covid-19, it lacks experience in preventing” such situations, he said.

Taiwan has purchased 5 million doses of the Moderna coronavirus vaccine, 10 million of the vaccine developed by Oxford University and AstraZeneca, and another 4 million doses through Covax, the World Health Organization-backed initiative for equitable vaccine distribution, but it is still awaiting the shipments.

Chiang Wei-Hua, 72, lives with about 600 other elderly residents in the Banqiao Veterans Home in New Taipei City, where the staff is on high alert. Residents are served meals at their door. Every morning and evening, they have their temperatures taken. Chiang is waiting his turn to be vaccinated; there are limited slots and they must wait until they receive notice from the hospital.

“I have no idea where and when I can get vaccinated,” he said.

To save its limited supply of vaccine doses, the government has stopped offering shots to the general public. Hospitals have canceled existing bookings or asked residents to wait until after June 8 to give priority groups such as health workers and elderly citizens more time. New bookings at some hospitals were put on hold until more vaccines can be supplied.

“I am anxious not that I cannot get the vaccine but because of the lack of vaccine coverage in Taiwan,” said Hsieh Meng Ying, 33, who works in publishing in Taipei.

The outbreak has given an opening to critics of President Tsai Ing-wen’s administration, previously lauded for its pandemic policies. Pro-Beijing opposition politicians have called on the ruling Democratic Progressive Party to import Chinese vaccines. The Chinese state-run tabloid Global Times blamed Tsai’s party for having “politicized the pandemic” in refusing Chinese vaccines and causing an “embarrassing shortage.” China has offered vaccines to Taiwan through Covax, but Taiwanese law bans the use of Chinese vaccines.

On Tuesday, Tsai said two locally made coronavirus vaccines were undergoing clinical trials and would be available in July and that other vaccines obtained through “various channels” would soon arrive.

“Please everyone, do not worry,” she said.

On Tuesday, the streets of Taiwan’s capital were deserted as residents stayed home at the government’s urging, and shops closed or required customers to register and disinfect before entering. Grocery stores’ shelves were emptied of meat, instant noodles and other goods.

“We spent a lot of time thinking we are great and being complacent,” said Chiang, the writer in New Taipei City. “We are like the hare,” he said, referring to Aesop’s fable of the tortoise and the hare.

Still, he said, “I hope in the end, this metaphor proves to be wrong.”

Pei Lin Wu in Taipei and Lyric Li in Seoul contributed to this report.