Before the pandemic, Anna and Josh Knight and their two small children enjoyed a social rowhouse life in Northwest Washington. From their elevated front porch in Mount Pleasant, they could chat with friends to the left or right. Out the front door, they could walk their kids three minutes to the Rosemount Center, an English- and Spanish-speaking day care. From there, it was another short stroll to Past Tense for yoga or Pear Plum Cafe to drink coffee with members of a Facebook group for area parents.

The virus upended that life. The day care closed. Then Josh’s office in Northern Virginia shut its offices. He was sent home, where Anna had always worked remotely for a professional services firm. Jammed together day in day out, the couple found themselves scrounging for office space or hiding from the kids on Zoom calls.

So, like multitudes of city residents stricken with coronavirus cabin fever, the Knights decided they needed more space — a desire fueling a pandemic real estate boom.

According to statistics from TTR Sotheby’s International Realty, the real estate market in the city and the surrounding region is red hot. In July, $5.3 billion worth of homes sold in the District; Alexandria, Arlington, Prince William, Loudoun and Fauquier counties in Virginia; and Montgomery, Prince George’s, Anne Arundel counties plus the Eastern Shore in Maryland. Last July, the figure for those same places was $4.2 billion.

With mortgage rates dipping below 3 percent, “People are coming out of the woodwork,” said Courtney Abrams, a vice president with TTR Sotheby’s based at the agency’s 14th Street NW location. Bidding wars are common and intense.

“People are feeling overwhelmed and cramped in the pandemic,” she said, “and it’s pushing people to buy now because we don’t know what the fall is going to look like if the virus spreads and people get locked in their houses.”

The Knights are part of that wave, exchanging their 2,400-square-foot rowhouse with a speck of a backyard for a 3,000-square-foot unattached Colonial with a bigger yard in the District’s Chevy Chase neighborhood, near the Maryland border.

“If it weren’t for the pandemic, we would have stayed in Mount Pleasant for a few more years. We honestly were just too busy to move. . . . Plus, we had this incredible friend group. Everyone was international and had really interesting jobs,” said Anna, 40, who helps run her firm’s corporate social responsibility programs. “But during the pandemic, my job was demanding more of me — we’ve been helping nonprofits survive covid-19 — and my husband and I found that we couldn’t really have two full-time working professionals working with enough privacy to do our jobs the way we wanted.”

The buying frenzy comes at a time when many laid-off workers are living in fear of eviction. It is another way the pandemic has revealed the region’s stark inequalities.

Shortly after the World Health Organization declared the coronavirus a pandemic on March 11, hardly anyone wanted to put on or attend an open house. The number of weekly new home contracts in the District began to plummet, especially compared with figures for the previous year at the same time.

Between March 22 and March 28, only 135 new homes went under contract, compared with 239 for the same week in 2019. But in late April and early May, the numbers began to rise, eventually growing larger than last year’s figures and holding the lead since June. Between Aug. 16 and Aug. 22, the ink dried on 221 new home contracts versus 141 for the same week in 2019.

Prices are soaring. In July, the average sales price of a home in the District rose to $787,000 from $722,000 in July 2019. In Fairfax County, it jumped to $672,000 from $613,000 during the same period. In Montgomery County, it increased to $600,000 from $573,000.

Some buyers are fleeing city apartments or condos for suburban homes with spacious backyards that would be prohibitively expensive in the District. Others are just upgrading from small spaces to slightly bigger ones because even a smidgen more room — a workspace tucked away from Zoom-bombing kids — can make a vast difference.

“People are willing to go farther out than where they were willing to in the past because now they’re working from home,” Abrams said. “They don’t have to worry about commutes to their offices.”

Her clients and good friends, Sarah and Jonathan Hutchins, are leaving their one-bedroom apartment near 14th and W Streets in Northwest Washington for a 1960s split-level home in the Fairfax County community of Mantua. The couple, both in their mid-30s, moved to one of the District’s most dynamic neighborhoods three years ago precisely because they’d been so bored living in their previous home in suburban Maryland.

Pre-pandemic, Sarah didn’t mind the constraints of their 960-square-foot apartment, which lacked a balcony or direct access to outdoor space. She was always on the road, flying to Italy, India, or Mexico for her job as an events planner. Jonathan, a finance director for a health-care nonprofit organization, enjoyed walking to his office at 14th and K streets.

When she wasn’t traveling, Sarah would hit up the nearby SoulCycle studio four times a week, or the Orangetheory Fitness a block or so away, while Jonathan preferred the YMCA at the bottom of their building. For dinners out, they loved Le Diplomate, Rooster & Owl and Lupo Verde.

When the pandemic struck, they initially didn’t mind their new lives. She worked in the living room on the kitchen table, while Jonathan carved out a spot in the bedroom with a folding picnic table.

But the lack of outdoor space began nagging at them. They didn’t feel all that safe hanging out at public parks or along 14th Street, upset by the number of maskless pedestrians and uncertain about what kind of threat they posed. Then, they looked at the interest rates and figured they should at least take a look. Besides, they were planning on trying to have kids soon. Space — indoors and outdoors — would become a paramount concern, with or without the coronavirus.

“Once you take out the ability to walk to restaurants and eat out safely, the city life loses its appeal,” Sarah said. “And since we’re working home virtually, I am certain our offices are not going to say everyone needs to come in five days a week once the pandemic is over.”

In May, they placed a bid on a home in Alexandria. The house got 12 offers.

“We escalated $60,000 above the listing price and waived contingencies. We thought we were totally getting it,” Sarah said. “But we came in fourth place. One offer came in $100,000 over the asking price. We were like, ‘What the hell?’ ”

In early August, their offer on a split-level in Fairfax that had been sitting on the market for two months was accepted. Sarah liked that their new home had community — neighbors constantly chatting, biking and jogging — but also privacy, with spacious, wooded backyards. The four-bedroom, 2,600 square-foot home has enough room for everyone to work in solitude, and a spot for a SoulCycle at-home bike.

Joia Crear-Perry, an obstetrician-gynecologist, and her husband Andre Perry, a Brookings Institution fellow and author, moved three years ago from New Orleans to their Dupont Circle rental. She works from home as the president and founder of the National Birth Equity Collaborative, a nonprofit organization dedicated to Black maternal and infant health; Perry, a scholar on race, structural inequality and education, has an office at nearby Brookings but often works from home.

Their two oldest children are grown, but their youngest is a third-grader at Ross Elementary School. The family wasn’t in a rush to buy a home since Dupont Circle’s prices can be quite high. Plus, Perry and his son, Robeson, liked walking to work and school.

But the pandemic made them rethink their plans. With everyone at home, they decided to buy a three-bedroom home in National Harbor in suburban Maryland.

“I feel privileged to be even having this conversation because I can’t imagine how a person who is less resourced than us — in terms of income and the capacity to navigate change — is dealing,” Crear-Perry said. “But distance-learning with our third-grader and trying to have a husband go on MSNBC and then me taking calls in a two-bedroom is not sustainable.”

When the family moves in later this month, they’ll be able to walk across the Woodrow Wilson Bridge into Old Town Alexandria and take quick drives to Georgetown and Reagan National Airport.

“Their choice to go outside D.C. was quite the turn of events,” said their real estate agent, Trian Johnson. “Andre was like, ‘Let’s do it’ when we were on the home tour. A few hours later, we were the first to make an offer. And there was another offer that came right after.”

Even the spouseless and child-free have been craving more space.

Sean Dugan, 33, a lobbyist who is single, had been living in a 500 square-foot condo in Northeast Washington’s Kingman Park for the past five years. But once he was forced to work from home, suddenly all he could notice was the place’s flaws: walls so thin he could hear his neighbors have intimate personal or work phone and Zoom calls. He feared they could hear his own conversations, so he often stepped out onto a fire escape to chat with friends.

In early April, with the prospect of working from home for a long time, he called his real estate agent and scoured the market. He wanted another condo, just one that was bigger, in a building with a pool. He looked in Petworth, Trinidad and Capitol Hill, but everything was too expensive. He put in offers for 10 homes, but kept getting beat. He realized he needed to find something under his budget in case he got laid off and was stuck with a mortgage that would be beyond his means.

Eventually, he found a one-bedroom condo near NoMa, just shy of $500,000. It also has a pool.

“It was sold to me as a place where you could not hear your neighbors,” Sean said. “That was exactly what I wanted to hear.”