He had been in the hospital for seven days when doctors declared he might not make it out alive.

His blood oxygen levels sank. His lungs struggled. The ventilator helping him breathe, doctors at Virginia Hospital Center said, did not seem to be doing much good.

Nurses called his family. His family called a priest. They wanted to make sure Francis Wilson, 29, received last rites before the end.

Wilson, a George Mason University law student, was among the first wave of coronavirus patients admitted to a Washington-area hospital last month. He was an outlier — young, healthy, no preexisting conditions. But by the time he called an ambulance, he could barely stand up without gasping for air.

He was also one of the first cases in which doctors watched a patient come so close to death — and live.

As the national coronavirus death toll continues to climb, hospitals are examining stories like Wilson’s for lessons and holding them up as glimmers of hope. He is among about 48,000 people nationwide to beat covid-19, according to Johns Hopkins University estimates, and among the youngest in the region forced into an intense battle for survival.

For a week after returning from the hospital, Wilson quarantined at home to make sure his symptoms were really gone.

Now, he said, he’s figuring out what to do with the adaptive immunity that medical experts have said covid-19 patients are likely to have when they recuperate. It means he should be immune to the coronavirus — although it’s not clear for how long.

“After I’ve taken this thing on, I really feel like I can handle anything,” Wilson said a week after leaving the hospital.

But recovery has its challenges.

Nightmares and flashbacks wake him in the night.

More than once, Wilson said, he has jolted awake thinking he had ripped out his breathing tube or IV lines. He has dreams about being buried alive, testing positive again, watching his friends die, infecting people without knowing it.

Memories from the 11 days he was in a medically induced coma return with little warning. He’s spent hours trying to piece them together.

“Most of the time I was under, I don’t remember anything, but for some reason, those moments when I was closest to death, my brain retained not only the memory of the stimuli occurring around me, but it retained my hallucinations or dreams while I was under, as well,” he said. “That’s been one of the strangest things for me to try to work through. Why do I remember this? Is any of it real?”

Wilson started to feel sick on March 8, the day after the rector at Christ Church Georgetown became the first person to test positive for covid-19 in the District.

The law student’s symptoms were mild at first: sore throat, headaches, a slight cough, feeling sluggish and tired. Wilson said he thought it was spring allergies.

At the time, few Americans realized that widespread community infection had probably already begun beyond Washington state, where the United States saw its first fatal infection clusters of the virus.

Doctors in the District at the time were still asking about travel histories and exposure to people who had tested positive. Mayor Muriel E. Bowser (D) did not declare a public health emergency until March 11. News coverage and scientific studies indicated that young, healthy people were at low risk.

Wilson had not been out of the country. He was not in contact with anyone who he thought had the virus. But a week later, he felt worse. He went in for a flu test, which came back negative, and a pneumonia test, which came back positive.

Wanting a more detailed diagnosis, Wilson said, the doctor requested further testing, including checking for covid-19.

Three days later, Wilson found out he had the novel coronavirus. By then, he had already called an ambulance to take him to the hospital.

It took him an hour to get from one room in his one-level apartment to the other. Standing up knocked the wind out of him. When he started to cough, he couldn’t stop. A friend he had gone bowling with the week before also developed symptoms.

Doctors at Virginia Hospital Center told him they were going to put him under general anesthesia for further monitoring and connect him to a ventilator to help him breathe.

“We didn’t know how serious his situation really was at the time,” said his father, Henry Wilson. “We thought when he got to the hospital that they would take care of it and he would be getting better soon. But then it only got worse.”

Francis Wilson had been on a ventilator for seven days when his parents received a call from an ICU nurse telling them they had to come in right away.

At Virginia Hospital Center, the family was given protective masks and gloves and told they could see Wilson — who was being monitored in a negative-pressure room used to treat covid-19 patients — only from behind a glass wall.

The hospital had done all it could, a nurse told them, and he wasn’t getting better. Doctors wanted to transfer him to George Washington University Hospital, where medical staff have the ability to administer extracorporeal life support — a technique that allows the blood to be oxygenated outside the patient’s lungs. It’s typically reserved as a last-ditch effort to save someone, said GWU Hospital spokeswoman Christine Searight.

But it would take 20 minutes to transfer him, and the medical staff worried Wilson might not survive the journey, said his sister, Bernadette Wilson.

“You start to bargain with God in situations like that,” Henry Wilson said, his voice cracking. “He looked so peaceful, but I realized that it could be the last time I spoke with him. I said, ‘Francis.’ I shouted, ‘I want you to live.’ ”

Somehow, Francis Wilson said, he heard their voices. His parents telling him to pull through. His sister saying they had too many things still to do together.

He describes it as an “out-of-body experience.”

Once at GWU Hospital, Wilson started to improve. The doctors were able to “ratchet up the settings” on his ventilator, Searight said, and his lungs seemed to respond for the first time in more than a week.

Two days later, Anna Wilson received a text message from her son.

It said: “Mom, I’m alive.”

Today, Wilson is again in uncharted territory. How do you reenter a world that looks nothing like the one you knew? How does it feel to have survived a virus that is killing people by the thousands every day?

Wilson said his goals are simple: He wants to visit his parents, both in their 70s. He wants to hug his mom, maybe get his sister to give him a haircut.

Once he gets the all-clear from his doctors, he wants to donate plasma to help other coronavirus patients beat the disease.

Most of all, he said, he wants people to take his story as a lesson.

Correction: This story was corrected to indicate that Francis Wilson attends law school at George Mason University, not Georgetown University, as originally reported.