RICHMOND — The angry calls and emails began flooding in after a blackface photo from Gov. Ralph Northam’s medical school yearbook page appeared on the Internet.

For several weeks following Feb. 1, 2019, the small staff of Northam’s community liaison office absorbed the anguish and profanity of a public that wanted Northam gone. Loved ones urged the staffers themselves to quit rather than take that punishment — especially those who were Black, such as Traci DeShazor, the leader of the liaison office.

But all of them stayed. And so did Northam. And now the Democratic governor and his administration prepare to leave office on Saturday under very different circumstances.

Over three tumultuous years, Northam recovered from the scandal to become what Sen. Tim Kaine (D-Va.) calls the most consequential Virginia governor of the modern era. Northam led a Democratic majority in the General Assembly to abolish the death penalty, expand access to the vote, legalize marijuana and pass a long list of other changes, large and small.

Kaine, who is a former governor, once joined the chorus calling for Northam to resign. Now, he says, “I’m glad he didn’t listen to me.”

Northam’s rebirth is as unlikely a story as any you might find in today’s polarized world of instant cancellation. It was driven partly by an extraordinary effort to connect with Black constituents across Virginia, a process that Northam says broke him down and built him back a better person — more aware of the ugly reality of race in America.

“I’m not sure I would have signed up for this experience, but it’s really just opened my eyes,” Northam said in an interview. He cited a favorite aphorism: “The eyes can’t see what the brain doesn’t know. My brain knows a lot more right now than it did before February of 2019. And I think that’s — that’s — that’s a good thing.”

But just as much, his comeback was driven by the capacity of those who were most insulted by the scandal to forgive and move on.

“Black Virginians gave the governor a second chance,” DeShazor said, “and I think he used that opportunity for good.”

***

Northam’s political career always seemed built around who he was more than on any great skill as a politician.

The courtly, soft-spoken son of a judge and a nurse from the Eastern Shore had to be recruited to run most every step of the way. A pediatric neurologist at a time when health care was a top issue, an Army veteran in a state that prizes military service, Northam was a centrist who voted for Republican George W. Bush for president and had been wooed by both parties before running for the state Senate as a Democrat in 2007.

He served as lieutenant governor under larger-than-life Gov. Terry McAuliffe (D), then trounced a more liberal opponent for the Democratic nomination for governor. He won the top job over Republican Ed Gillespie by nine percentage points in 2017, riding the first surge of Virginia revulsion to the presidency of Donald Trump.

Behind his seemingly effortless rise, though, Northam had quietly worked for years to build support around the state — campaigning for Democrats in out-of-the-way places, fishing with Republican pals. So when he took the reins from McAuliffe, his administration peaked quickly.

In 2018, he worked with a GOP-controlled General Assembly to expand Medicaid — something the more aggressively Democratic McAuliffe had never managed to accomplish. And Northam landed the biggest economic development coup of the year — building on work begun by McAuliffe — when Amazon awarded its second headquarters to Northern Virginia.

Heading into the 2019 General Assembly session, though, that initial momentum was spent. The administration “was kind of rudderless. They didn’t know where to go,” said Mark Bergman, Northam’s political adviser and longtime confidant.

With partisan divisions flaring thanks to the Trump-inflamed climate in Washington, Northam stumbled into the national crosshairs that January by making unclear comments about a late-term abortion bill that conservatives seized on to accuse the doctor-governor of supporting infanticide. It was a false allegation, but Northam did little to clarify his remarks.

Right-wing commentators launched a full-on attack that culminated Feb. 1 with the online publication of the 1984 Eastern Virginia Medical School yearbook photo. Printed on a page labeled Ralph Shearer Northam, the photo depicted one person in blackface standing next to another in a Ku Klux Klan robe.

Social media went nuts. Northam, who was on his way to a funeral that Friday afternoon, sped back to Richmond. Those who spoke with him in the mad rush that followed describe him as shellshocked, protesting that he didn’t remember the photo.

Jennifer L. McClellan, a Black state senator from Richmond, remembers picking up her children from day care that evening and getting a call from Northam. He wanted her to know he was sorry for the pain the photo was causing.

“I just kind of remember being in shock, like, this just does not make any sense. And I said to him, ‘That is not the Ralph Northam I know,’ ” McClellan said in an interview.

Northam agreed to meet that night with members of the Virginia Legislative Black Caucus. McClellan got there early and sat with Northam in his office in the Patrick Henry Building.

She felt disoriented, numb, “like the aftermath of a train wreck,” McClellan said. “And I remember asking him, ‘Which one are you?’ And he said, ‘Does it matter?’ And I thought to myself, ‘I don’t know how to answer that.’ ”

After McClellan left his office, Northam put out a statement and a video message taking responsibility for the photo, acknowledging that he was in it. In an emotional meeting with the Black caucus, Northam wondered if it was time to go back to practicing medicine.

But a sleepless night spent talking with friends and people from medical school made Northam change his mind. The photo was some kind of mistake, he decided. He told aides he was going to reject near-universal calls to resign.

Preparing to face the national media, a portrait of civil rights icon Oliver Hill looking on from a wall of the Executive Mansion, advisers asked Northam if he was sure.

“They all think you’re coming out here to resign, and you’re not, and it’s going to be like a bomb went off,” Bergman remembers telling him that Saturday. “And he goes, ‘Yup, let’s do it.’ ”

What followed went as poorly as Bergman might have imagined. Northam appeared dazed. Never a strong communicator, he disavowed the photo but couldn’t explain why he was changing his story. He admitted darkening his face to imitate Michael Jackson for a dance contest later in 1984. When a reporter asked if he could still moonwalk, Northam seemed on the verge of demonstrating, until Pam Northam sternly put her hand on her husband’s arm.

Calls for his resignation intensified. A Sunday night meeting with Black administration officials went poorly, according to people who were there, with several giving vent to an angry sense of betrayal.

By the end of the next week, Northam made a pledge: He would stay and devote the rest of his term to fighting racial inequity.

McClellan met with him again, trying to gauge what to do next.

“I asked him point-blank, ‘Can you explain to me why blackface is wrong?’ And the answer I got told me he didn’t fully understand,” McClellan said.

Northam told her he had grown up in integrated schools. He played sports with Black athletes, had Black friends. He was comfortable with race. But blackface — it was a blank spot. He just didn’t understand its origins or meaning.

“I came to the realization that, okay, you’re not racist. You’re race-ignorant,” McClellan said. “And I think I can work with that.”

***

The “yearbook incident,” as Northam now refers to it, sent the governor into weeks of near-seclusion. He used an old system of tunnels to get from the Executive Mansion to state offices.

As the General Assembly session plowed on without him, Northam’s staff — with the help of the Black caucus — began arranging meetings for him with African American leaders all over the state.

Danville, Roanoke, Petersburg, Charlottesville, Dumfries, Loudoun and more — quietly, Northam sat with groups of 10 or 20 people in each place. Civil rights leaders, ministers, elected officials, businesspeople. And they let him have it.

“They were incredibly raw,” said DeShazor, who as deputy secretary of the commonwealth worked with press secretary Alena Yarmosky to set up the meetings. “We didn’t make any apologies for the governor. … He sat and he took it and he listened. There were tears shed by members of the community, by us as staff. By the governor.”

DeShazor was among a host of Black administration officials who came under tremendous outside pressure to quit. She said a supportive friend sent a message that stuck with her: “God has prepared you for a time such as this.” DeShazor decided she could make the most difference by staying and working from the inside.

Black lawmakers found that many African American constituents — particularly older ones — were quick to forgive Northam. Polls, in fact, showed that Northam’s approval recovered more quickly among Black voters than White voters.

Richmond Mayor Levar Stoney, who is Black, described going to an event during the scandal and being pulled aside by an elderly Black man. “He was like, ‘Now, Mayor, don’t go there on giving Governor Northam a hard time. We all make mistakes.’ To me, that was telling,” Stoney said.

After months of listening and reading up on Virginia history, Northam’s first big public test came at an event that centered on race: speaking at Old Point Comfort on Aug. 24, 2019, to mark the 400th anniversary of the arrival of the first enslaved Africans to the English colony of Virginia.

Earlier Northam speeches often pulled their punches. He would make gauzy references to equal opportunity for “every Virginian, no matter whom they are or where they live,” as he put it in his inaugural address in 2018. When he spoke of 1619 in interviews shortly after the blackface photo surfaced, he had referred to those first African arrivals as “indentured servants.”

But now he struck a tone both sharper and more nuanced. “I have had to confront some painful truths,” he said. “Among those truths was my own incomplete understanding regarding race and equity.”

He referred to “enslaved Africans,” noted that the new government in Jamestown did not represent them, and said the burden of reckoning with that past had too long fallen solely on people of color. He characterized racism as “part of a system that touches every person and every aspect of our lives, whether we know it or not.”

And when Northam said “Black history is American history,” he drew a thunderous ovation.

“He was the right man” to give that speech, said Del. Delores L. McQuinn (D-Richmond), a senior member of the Black caucus. “Here was a man, in many ways, that was at a vulnerable place in his life. … I looked for a wounded healer that could now take his experience and begin to create and build a bridge that would now help others again.”

That day, Northam announced the formation of a commission to review how African American history is taught in schools. It was the beginning of a policy stream that began to flow out of his process of reckoning, with chief of staff Clark Mercer charged with pushing state agencies to come up with ideas.

Northam appointed a commission to plumb the depths of state code and find racist language that persisted, in many cases, from the time of Jim Crow. The General Assembly took the findings and carved the offensive language out of the law books.

He appointed the first Cabinet-level diversity officer in any state, and charged her with devising standards for all state agencies that could be shared with local governments and institutions.

Northam proposed measures to begin addressing disparities in maternal mortality rates among women of color and pushed for tax cuts aimed at the working poor. Over the next three years he issued more pardons than many previous governors combined and restored civil rights to more than 120,000 people convicted of felonies, many of whom were Black.

“I think if the … scandal had not occurred he would not have been as effective,” said Jatia Wrighten, a political scientist at Virginia Commonwealth University who studies racial issues in state legislatures.

“Out of unfortunate events can come great things, and that’s exactly what happened here,” said Cynthia Hudson, a Black former chief deputy state attorney general who led the effort to find racist language in Virginia’s laws. The scandal, she said, “reshaped the trajectory and the consequence of this administration.”

As the reckoning rolled on, an astonishing number of major events began demanding the governor’s attention — and tested his fragile political capital. When a mass shooter killed 12 people at the Virginia Beach municipal center in May 2019, Democrats rallied with Northam to call for gun control — but the appearances were fraught, because many of them had never rescinded their calls for him to resign.

McAuliffe had stepped in to campaign with Democrats for much of the year in Northam’s absence, but the governor slowly began to fundraise again. In that fall’s elections, Democrats surged to unexpected majorities in the House and Senate.

Now Northam had something no Democratic governor had enjoyed in a generation: consolidated power. He worked with House Speaker Eileen Filler-Corn (D-Fairfax), the first woman to ever hold that role, and Senate Majority Leader Richard L. Saslaw (D-Fairfax) on ambitious agendas of change.

Over the next two legislative sessions they made Virginia the first Southern state to abolish the death penalty and legalize marijuana; instituted no-excuse early voting and passed a state version of the Voting Rights Act, guaranteeing minority access to the polls; and instituted a wide-ranging overhaul of the criminal justice system aimed at breaking the cycle of disproportionate impact on minorities.

By the time the coronavirus pandemic hit in 2020, Northam seemed to have found his new political footing. Stoney wound up working closely with him.

“Fast-forward to March and we’re on the phone talking about whether we’re going to shut down restaurants,” Stoney said. It was uncomfortable at first, he said, because of the unspoken fact that Stoney had once demanded that Northam resign.

“I didn’t know how he would respond to me. Right? Did he want to be around me? Did he want to be in my presence?” Stoney said. “But I think just like the grace that many of us offered him, he offered that same grace back to … those who called for his resignation.”

When Richmond’s streets erupted with social justice protests that spring after the murder of George Floyd by a Minneapolis police officer, Northam made no effort to grandstand. Instead he worked with governor’s counsel Rita Davis, the first Black woman to hold that role, to devise a strategy to take down the titanic statue of Confederate Gen. Robert E. Lee that stood on state property on Richmond’s Monument Avenue.

He and Attorney General Mark R. Herring (D) fought a lawsuit filed by five local residents all the way to the Virginia Supreme Court to remove the statue. When it finally came down this past September, Northam defied his security detail’s recommendation and stood on Monument Avenue watching. He wore a bulletproof vest under his shirt, a precaution adopted since the scandal.

Republicans say Northam and his party went too far. Thanks to a Republican surge in November’s elections, political newcomer Glenn Youngkin will succeed Northam in the Executive Mansion, and the GOP will reclaim the majority in the House of Delegates when the General Assembly convenes Wednesday.

Republicans have hammered Northam for various missteps, sometimes referring to him as “Governor Blackface.” The state’s parole board caused its own scandal by releasing inmates without properly notifying families and prosecutors, which Republicans attributed to a Democratic administration gone soft on criminals. The Virginia Employment Commission, starved by years of underfunding, struggled to respond to the economic shutdown caused by the coronavirus pandemic, and Republicans blamed the administration.

And Northam’s initial response to the pandemic drew criticism as the state’s testing program lagged most others in the country. Those struggles eased, though, and today Virginia is regarded as having performed well during the crisis, ranking among the top 10 most-vaccinated states.

Northam also drew fire last week when an unexpectedly harsh winter storm left travelers stranded on a stretch of Interstate 95 for 24 hours or more — including Kaine. During a testy radio interview, Northam snapped that he was “sick and tired” of people questioning what went wrong with the state’s response and suggested that travelers should have heeded warnings and stayed home.

Some on the left have criticized Northam for failing to go even further in his policies. He never challenged the state’s right-to-work law, for instance, which has the effect of tamping down union membership. Northam also infuriated environmentalists by not taking a stand against two major natural gas pipeline projects, despite charges that communities of color would be disproportionately affected.

And the fact remains that for all of Northam’s more enlightened rhetoric, Black Virginians continue to be incarcerated at a higher rate, live in worse poverty, and struggle to get quality health care and education.

“It is very hard to unravel decades and centuries of inequity overnight, but he definitely put Virginia on that path and he brought the full weight of his power as governor and his administration to that effort,” said McClellan, one of the gubernatorial hopefuls who lost the Democratic nomination to McAuliffe last year. “But we’re not there yet, and it’s up to all the rest of us still in positions of power to keep that movement going.”

***

As incredible as Northam’s political comeback has been, it still turns on a mystery: Who is in that photo?

Most people interviewed for this story said they believe Northam’s claim that it’s not him, but the picture and its origin have never been fully explained.

Two investigations — one conducted by Northam’s political action committee, the other by the medical school — failed to reach any conclusions. Today Northam says he is “99 percent sure” he knows the identity of the person in blackface.

“He’s been talked to,” Northam said in the interview. That person’s “name is very close to mine,” he said, meaning alphabetically, “and was also in that medical school class.”

Others familiar with the situation but speaking on the condition of anonymity because they are not authorized to speak publicly said the person did not finish medical school and did not have their own page in the yearbook.

Northam said he thinks he knows who the person in the Klan robe was, too, but that they also would not cooperate with investigators. Neither would the person in charge of putting photos into the yearbook.

“We got as close as we could,” Northam said.

As for why he initially took responsibility for the photo, Northam blames that on stunned confusion and an impulse to hurry and do something. “I think people needed to hear from me, and I wish I had more time before I came out that night,” he said. “If I had it to do over again I’d have tried to take a little more time.”

People close to Northam say the experience took a personal toll. “I think it was a very difficult journey,” said state Sen. Richard H. Stuart (King George), a Republican friend who always told Northam to resist the calls to resign. “I think he gave it his all, and I have great respect for that even though I disagree with a lot of the policy choices.”

Northam makes no secret that he’s itching to get back to his medical practice in Norfolk — he plans to see patients the Monday after his term ends. But he said the past three years have changed him for the better.

Northam found a parallel for his own experience in the book “Robert E. Lee and Me” by Ty Seidule — also White, also a Virginian, and who attended Washington and Lee University while Northam was next door at Virginia Military Institute. They didn’t know each other, but Northam recently invited Seidule to Richmond to talk about their shared experiences — down to the fact that Northam had a boyhood dog named Rebel while Seidule had Dixie.

In his book, Seidule takes up one icon after another from his youth — Lee, “Gone With the Wind,” elementary school textbooks — and explodes them, angrily dissecting the myths he was fed as a youth. Lee, he famously concluded, was simply a traitor.

Northam has marked several passages in his copy. One of them: “I grew up with a series of lies that helped further white supremacy.”

Northam “read my book because I’m like him, in a way,” said Seidule, a former U.S. Military Academy professor who now teaches at Hamilton College in New York. “We grew up in this milieu … about maintaining political power through Jim Crow laws, through violence, through voter suppression, through Confederate monuments. All these things reinforced White political power at the expense of Black people. That’s the way we grew up.”

Talking about it now, Northam sounds both perplexed and a little angry.

“I’ve driven down Monument Avenue many times and never really thought about, you know, when [the statues] were put up, why they were put up — you know, what the intent of the people that put them up was,” he said. “But I understand that now. … This is not an excuse for where I sit today and what I’ve been through, but what I was taught was not accurate history.”

That new perspective fueled one of the most personal challenges Northam faced: dealing with accusations of systemic discrimination and racism at VMI.

Northam said he wants to continue building on the lessons he has learned. He and his wife are exploring the idea of starting a foundation to promote early-childhood education, he said, and Northam plans to work to fight disparities in access to health care.

“A lot of people will … continue to say, ‘Okay, Northam, we saw how you responded to the yearbook and what you did. Is it going to stop when you walk out of this office? Are you the real deal?’ ” he said. “I’m going to keep working on these issues because I feel that is the right thing to do. But I also feel that I want to support or help those people that have been so supportive of me.”