The first precious boxloads of the frozen elixir arrived in December, bearing great promise for curtailing the pandemic that has paralyzed the region and the world.

Nurses and firefighters got injections on live TV. Some of them cried. Watching at home, many hopeful people cried, too.

But in the weeks that followed, that hope was mixed with frustration, then anger, as it became clear that getting the potentially lifesaving vaccine would not be easy — not nationally, and not in the District, Maryland and Virginia.

Hospitals in D.C. and Virginia scheduled appointments, then canceled or postponed them. Maryland residents registered at vaccination clinics in Prince George’s County, only to see rules created overnight that barred them from getting their shots. Govs. Larry Hogan of Maryland and Ralph Northam of Virginia and D.C. Mayor Muriel E. Bowser announced that millions of people were eligible. But when those people called and emailed and waited in front of their computers for hours, they couldn’t get through.

What went wrong? The story of how the region’s governments left millions of residents confused and fearful as officials took on the most important public health challenge in decades is a tale of a complicated and faltering chain of command, in which Hogan (R), Bowser (D) and Northam (D) acted on bad information and changing directives from the federal government, and local leaders scrambled to respond to late-arriving and shifting guidance from the states.

This account, based on 30 interviews with government officials and hospital and medical workers, shows how public health officials battered by months of fighting the pandemic were caught unprepared for the arrival of the vaccine that could stop it in its tracks.

Again and again, officials made an initial choice about how to distribute scarce doses, then reversed course when their hastily made plans led to unforeseen problems.

If the United States and the region had prepared well for the vaccines while scientists were developing them, University of Maryland public health professor Donald Milton argues, residents would have registered for their shots months before the vials arrived.

“There should have been a plan . . . along with funding to hire and train staff starting from last summer,” Milton said. In the absence of that preparation, the vaccine is often “going to well-connected and wealthy people at low risk, and not to the people of color who have been hit the hardest.”

Retiree Janett Gasaway echoed the deep frustration of many when she testified at a recent day-long hearing of the D.C. Council. Her voice cracked as she described waiting in a 400-person phone queue to sign up for a shot, only to be told all appointments were taken and she couldn’t even leave her name. She had hoped that her disabled 89-year-old husband could get a shot even if she couldn’t.

“They say they have no appointments to schedule,” Gasaway said. Then she interrupted herself, looking at the faces of her council members in their minuscule Zoom boxes, and added, “If you are still listening to me.”

D.C.: A search for racial equity

The task of distributing vaccines was in many ways less complicated for the District than for any state — the city has only one health department and could make and enforce centralized decisions.

Still, there were stumbles, especially an emotional reckoning over racial disparities that has led to ongoing overhauls of the city’s distribution plan — and an uproar in wealthy neighborhoods that feel shut out despite receiving by far the most shots.

The initial complaints were technical: people signing up had to enter a “captcha” code multiple times, a task nearly impossible for some with disabilities; some who clicked to “change” their appointment time found they had actually canceled it, with no other time slots available.

“If [public health officials] had grandmothers, they would have predicted that,” Bonnie Levin, an assistant vice president at MedStar Health who is overseeing vaccinations, quipped about the website issues. “Honestly, what’s happened is this all has happened so quickly that to build the technology to do this has been really challenging.”

The city booked appointment slots at La Clinica del Pueblo, one of the many health clinics enlisted in the vaccination effort, three days before the clinic had told the city it would be ready to accept patients.

“We had people come and show up for appointments that they had scheduled, and we were not ready to be able to vaccinate them, and then we had to turn them away,” said Catalina Sol, the clinic’s executive director. “That was tremendously stressful.”

Some hospital leaders said they were surprised at times when the D.C. health department asked them to vaccinate different priority groups, like teachers or police officers. “We were ‘voluntold,’ ” said Anita Jenkins, chief executive of Howard University Hospital. She then rephrased: “No, no, we were given the opportunity — it didn’t matter to any of us who we got.”

The biggest problem in the District has been racial equity.

Two days after the city opened up vaccine registrations to senior citizens — and saw every appointment rapidly snatched up — members of the D.C. Council met with Health Director LaQuandra Nesbitt, worried that residents of wealthy, mostly White areas seemed to have grabbed most of the slots. They wanted to direct some appointments to residents of poorer neighborhoods, where far more residents have died of the virus.

Nesbitt said that approach would not make sense. Soon, she and council member Kenyan R. McDuffie (D-Ward 5) were shouting at each other. After the contentious meeting ended, they spoke privately, and Nesbitt agreed to look into the issue.

And then, McDuffie says: “Look, the numbers happened.” The health department gathered data and found that on that first day, residents of wealthy, mostly White Ward 3 booked nearly twice as many appointments as residents of any other ward, and more than 20 times as many as those in the poorest wards, 7 and 8.

Soon after, Nesbitt agreed to allow new appointment sign-ups for residents of underserved Zip codes one day a week, and then release appointments open to anyone in the city on a second day.

Weeks later, vast disparities remain — and some residents are fuming at being shut out of the sign-up system once a week.

Several council members have called for further overhauling the system (which is getting a new registration portal that will allow more targeting by Zip code), perhaps to create a lottery or a waiting list. Jurisdictions nationwide are struggling with similar issues.

“In a way, the entire country started off with a kind of democratic approach,” said George A. Jones, chief executive at Bread for the City, a nonprofit group that is distributing the vaccine and early on saw an influx of White recipients in its clinic waiting room, much different from its usual clientele.

“You have to be intentional about warding off these disparities,” Jones said. “Because if you just let sort of equality reign the day, you don’t get equal results.”

Virginia: Every county wants more doses

The vaccine plan Virginia submitted to the federal government around Thanksgiving included a list of every location in the state confirmed to have a freezer equipped to store the vaccine doses. State leaders thought they were well-prepared.

Then the vials arrived.

Within weeks, Virginia was at the bottom of national rankings, 49th among states for the percentage of the doses distributed. Hospitals hoarded doses, scared of not receiving more shipments. Health-care workers refused the shots. Rural health districts with shaky broadband were doing well at distribution but using paper records, instead of reporting to the state how much vaccine they had given out.

Changes since that sluggish start have sent the state zooming up the national listings, statistically, but also have caused bitter fighting about which counties and regions should get doses first.

Northam learned on a Jan. 12 call with governors and top federal officials, including Vice President Mike Pence and Health and Human Services Secretary Alex Azar, that the Trump administration would be releasing its stockpile of reserved doses. With more vaccine on the way, federal officials said, the governors should start vaccinating anyone over 65.

In Richmond, Northam’s chief of staff, Clark Mercer, recalled a swift reaction: “That’s the guidance we’ve been asking for. That’s great. Let’s go announce it.”

Within 48 hours, Northam expanded eligibility. The next day, news reports revealed there was no federal stockpile to rely on. Suddenly, millions of Virginians were trying to schedule appointments that didn’t exist.

The lack of a stockpile “kind of threw a wrench into what we were trying to accomplish,” Northam said. “We learn something new pretty much every day. . . . You have to call an audible. It’s an evolving process. It’s very dynamic. You literally have to look at what’s going on each day and make adjustments.”

With localities around the state clamoring for doses, Northam’s team changed how it apportioned the vaccine supply.

Initially, the team had steered doses to the jurisdictions best equipped to administer them. That meant populous Fairfax County, which with the Inova hospital system had set up a network of sites capable of delivering at least 30,000 doses weekly, was positioned to scoop up more than half of Virginia’s weekly vaccine allocation. County officials thought the system was fair, noting that the virus has caused the most harm in diverse Northern Virginia, disproportionately affecting Black and Latino residents.

But the state decided in late January to allocate doses to every health district on a per capita basis. Loudoun County’s weekly shipment shrank by 40 percent, to 4,275, and the county’s waiting list grew to 70,000 people. Inova canceled plans to vaccinate 12,000 essential workers in Fairfax County, including law enforcement officers and teachers.

“Seeing any empty room of vaccinators is really tough,” said Michelle Vassallo, an Inova vice president who is helping lead the hospital system’s vaccination efforts. She recalled seeing people cry tears of joy and relief as they received their shots in a converted cafeteria, talking about the day they would hug their children and grandchildren again.

“It was hustling, bustling. There was music playing. . . . We were at the height of our operations, smoothly moving through. And to have that shut down was just incredibly frustrating.”

Jeff C. McKay (D-At Large), chairman of the Fairfax County Board of Supervisors, called the situation “maddening.” The school board sent Northam an angry letter: “How can we tell our teachers that we want them back in our classrooms, but do not value them enough to provide the most direct form of protection available against this dangerous and still-evolving disease?”

But Northam and Mercer both expressed dismay that anyone was surprised by the change. “It was the plan all along” to transition to the per capita allocation system, Mercer said.

The revised strategy is meeting the goals that Northam demanded at an emergency meeting in early January. Virginia is now administering close to 30,000 doses per day, and for a while soared ahead of Maryland in its seven-day vaccination rate.

Mercer said he got a call from a Maryland official after that happened, asking for advice on how the neighboring state could catch up.

Maryland: Decentralized response

While visiting a nursing home vaccination clinic a few days before Christmas, Hogan discovered something that would color the trajectory of the rest of his state’s rollout.

“It was much slower than we anticipated,” he said in an interview. “We were surprised at the lack of urgency, and the lack of people that were willing to get it.”

As many as 7 in 10 workers at the state’s hundreds of nursing homes refused a shot. Hospitals also had low vaccination rates at first. The lion’s share of doses went unused for weeks.

Hogan told hospitals to either speed up or lose their doses, and he called the chief executives of CVS and Walgreens to express — bluntly, his aides said — deep displeasure with their efforts to vaccinate nursing home residents and workers.

Still, he planned to vaccinate the earliest-priority groups fully before moving on. As of Jan. 5, he said people ages 65 to 74 would probably have to wait until March.

Then federal officials changed their advice. Robert Redfield, then chief of the U.S. Centers for Disease Control and Prevention, came to Annapolis to urge Hogan to vaccinate seniors right away. President-elect Joe Biden’s incoming coronavirus czar, Jeffrey Zients, made the same request.

Hogan soon announced that people 75 and older could get vaccinated, followed by those 65 and older a week later. That swelled the pool of eligible people from 533,000 to nearly 2.1 million, even though just 80,000 doses were available each week.

The imbalance ensured that doses rarely sat unused. But it also caused new forms of chaos. Hogan did not tell county leaders of his decision in advance. Surprised officials, who heard about it at his news conference, responded with divergent approaches that further increased frustrations for their residents.

In Montgomery County, the state’s most populous jurisdiction, officials rejected the governor’s call in the name of racial equity, focusing on the tens of thousands of health-care workers who remained unvaccinated.

Montgomery has consistently distributed close to 99 percent of its doses, making it one of the most efficient jurisdictions in Maryland, said county Health Officer Travis Gayles. But because doses were scarce, and senior citizens still weren’t eligible, “There’s still this notion that we have a failed system.”

Elderly county residents found they could register in next-door Prince George’s County, which had complied with Hogan’s directive. But as Prince George’s officials realized their own residents were being shut out of vaccinations, they began canceling appointments made by people who neither lived nor worked in the county.

“We had to change very rapidly,” Health Officer Ernest Carter said. The entire episode, he added, showed the need for a national distribution plan. “None of this would have happened if there was an accurate playbook from the federal government.”

Maryland’s system remains diffuse, as state leaders designed it to be, with the state giving vaccines to more and more providers who run their own sign-up systems. Hogan says the massive ramp-up is working — the state was vaccinating an average of 24,500 people per day last week, compared with a few thousand per day in early January.

But critics say the decentralized sign-up process is nearly impossible for some residents to use. “We are hearing every day from constituents and local officials expressing immense frustration and confusion with the program’s inefficiency and inequity,” the state’s nine Democratic congressmen wrote to Hogan the other day.

For residents across the region who are frantic to get vaccinated, who jam websites until they crash, and wait for hours on the phone to no avail, the vaccine still feels out of reach.

Schneider reported from Richmond. Rebecca Tan, Rachel Chason, Lola Fadulu, Antonio Olivo and Jenna Portnoy contributed to this report.