The coronavirus could have been the last straw for City Bikes, an independent bike shop in the District that was on fragile financial ground before the pandemic struck. But last weekend, Charles McCormick found himself in his shop after midnight, assembling bike after bike. Sales had more than quadrupled.

“We have really gotten into the toilet-paper-flying-off-the-shelves phase over here,” said McCormick, who launched City Bikes 32 years ago. “I finally feel like the bike is getting recognized for the awesome tool that it is.”

The bicycle industry has emerged as one of the few beneficiaries of the novel coronavirus pandemic as people search for ways to stay active, entertain children and commute to work. The unprecedented demand has sent shock waves through the supply chain and left customers in a race to get their hands on a bicycle before they sell out.

Andrea Hewitt, a 38-year-old living in Arlington, has purchased two bikes since the pandemic struck. She needed a break, she said, from the daily grind of full-time work and part-time home schooling that grew more tedious, isolating and tiresome by the day.

“It felt like there was nothing we could do but walk outside, but then we got the bikes and I felt free,” she said of her early days in quarantine. “It was like some sense of normalcy had returned to our lives.”

Hewitt and her two children, ages 7 and 10, have quickly grown addicted to the new bicycles the family purchased from a local store in late March. Four times a week, the three of them strap on their helmets, mount their bicycles and meet with cousins down the block. The “bike gang of six,” as they now call themselves, then rides a mile to wave to their grandparents.

“My parents get a kick out of it when all of us pull up in our bikes,” Hewitt said. “It has allowed us to make extended family time a part of our weekly routine.”

Hewitt snagged the bicycles early in the pandemic, but many are now struggling to find an affordable bicycle available for purchase.

Bicycle sales nationwide surged by 50 percent in March, according to the NPD Group, a market research company. It reported a 121 percent increase in adult ­leisure-bike sales and a 59 percent uptick in children’s bike sales compared with the same time last year.

Industry names such as Trek Bikes are sold out of some lower-priced models, and businesses with inventory left are seeing it quickly dry up. Jamis Bicycles, a midsize brand that sells equipment to 600 independent bicycle dealers nationwide, shipped as many bicycles in April as it did in the three months prior. The company says it is on track to eclipse that total in May.

“We do still have inventory, but it is dwindling quickly,” said Dave Rosen, marketing and creative director at Jamis.

Spring typically marks the busiest time of year for the bicycle industry, and many sellers were behind schedule before orders started pouring in mid-March. Countries across Asia, where most bicycle parts are produced and assembled, were part of the earlier wave of coronavirus shutdowns. The shutdowns, combined with the Lunar New Year, stalled deliveries for about a month in February, according to Rosen and other manufacturers. Industry experts warn that low-priced and children’s bicycles will become more difficult to find until the next production cycle wraps up in late July.

Meanwhile, longtime cyclists are hoping the unexpected bike boom results in lasting changes to city infrastructure, such as protected bike lanes and regional networks of trails that allow for safe commutes. Last month, Montgomery County and other local jurisdictions closed select streets to vehicles to make more room for walking, jogging and cycling.

“This pandemic is fundamentally going to have to change the way we use public space to keep people safe,” said Colin Browne of the Washington Area Bicyclist Association. “And that ultimately means making more space for people to walk and bike.”

It is unclear, however, how long the cycling surge will last. Some speculate the craze will fizzle out when the weather turns cold and cities reopen parks, restaurants, movie theaters and other businesses. Others say it is here to stay, as a recreational activity and a vital form of transportation, with ride-hail services and public transit less appealing than before.

Logan Buzzell, a 28-year-old who works for an international development organization in the District, expects his recent bike purchase to change the way he commutes to his office when it eventually reopens. He had relied on Metro, Uber and bike-sharing services to get around in the city. But since the quarantine began, he has realized how much he enjoys riding his own bicycle.

“I had been lazily taking shared city bikes around town for two years,” he said. “But with the quarantine and the incentive of a stimulus check, I decided it was time to hunker down and get a bike.”

The newfound excitement around bicycles was palpable on Mother’s Day, when dozens of masked customers gathered outside City Bikes in Northwest Washington. One line flowed from the repair shop, and another formed from the bike purchasing window, where an employee behind caution tape beckoned customers into the building one by one.

Charlotte Maslog, 7, peered inside the store’s window waiting to see whether her mom would finally have a new bike to ride with her. Liliana Maslog, 46, had tried to purchase a new bicycle three times in the past few weeks. But each time, City Bikes had been sold out of bikes in her size and price range.

A few moments later, Liliana Maslog emerged from the building and triumphantly threw her hands above her head.

“That was not a bad way to spend my Mother’s Day,” she said, with a receipt for a new road bike in hand. “It’s finally my turn to ride, too.”