RICHMOND — Pamela Northam, self-described introvert, imagined a quiet life ahead when she settled down with a soft-spoken pediatrician from Virginia’s rural Eastern Shore.

“I thought I would live in the country and do country pediatrics for the rest of our lives,” said Northam, a pediatric occupational therapist. Instead, she wound up first lady of Virginia.

Given her aversion to the spotlight, even more surprising was just how Northam spent the past four years in a role that wraps up Saturday, when she and Gov. Ralph Northam (D) will hand the Executive Mansion over to Gov.-elect Glenn Youngkin (R) and his wife, Suzanne.

Northam used what could have been a purely ceremonial post as an opportunity to lead the charge to expand and improve early-childhood education, relentlessly lobbying legislators, chairing the governor’s Children’s Cabinet, and logging some 11,000 miles to make her case across the state.

She also stepped up — quietly, but critically — at a moment of crisis in early 2019, when the governor was nearly driven from office by a blackface scandal. In the anguished hours and days that followed, she was one of the most steadfast advocates for the governor’s sticking it out and turning the episode into an opportunity to double down on the cause of racial equity.

“Everyone has those times when you have to hold each other up and pull each other through,” Pamela Northam said in an interview late last month. She then pivoted to a very different crisis — one that had Virginia’s first couple up at 4 that morning, tending to their ailing 16-year-old lab, Murphy.

“The two of us were trying to hold him up and get him outside. And both of us were crying, I think, at one point this morning,” she said. “I was saying, ‘This is it. This is the end.’ He’s, like, ‘No, no. He’s okay. We’ll give him the medication.’ Then he’s saying, ‘No, it’s the end.’ And I’m saying, ‘No, no. He’s gonna make it.’ … In any great team and relationship … there are moments when you’re just not sure you’re going to make it. And that’s when your real friends really pull you through.”

With his wife’s support, the governor not only completed his term but mustered an unlikely comeback, working with a General Assembly that turned fully blue halfway through his term to deliver a host of long-sought Democratic goals: tightening gun laws, easing restrictions on voting, eliminating the death penalty and legalizing marijuana. The pre-K initiatives the first lady championed were part of that same equity push.

Over the course of Gov. Northam’s term, the state doubled funding for public pre-K programs, allowing the number of slots for children ages 3 and 4 to rise from about 18,000 to a record 25,000. Enrollment in Virginia’s child-care subsidy program, for use in private, church- and home-based centers, grew from about 21,000 to a record 30,000.

Pamela Northam “was a tremendous advocate for early-childhood education, and not just at the 30-foot view but actually in the weeds of the issue,” said Del. Glenn Davis (Virginia Beach), one of many Republicans won over by the first lady’s advocacy. “We wouldn’t be where we are today if it weren’t for her dedication and leadership on these issues.”

“I think the public perception of her is she is quiet, steady, very devoted and loving to the governor — which she is — but she is a political force in her own right,” said Jay Jones, a former Democratic delegate from Norfolk.

Northam followed the lead of her predecessor, Dorothy McAuliffe, by occupying an office in the Patrick Henry Building, where the governor and his cabinet secretaries also have their offices, instead of next door in the Governor’s Mansion — a signal that her work was an integral part of the administration.

Northam declined to revisit in detail the crisis of early 2019, which erupted after a racist photo surfaced from the governor’s 1984 medical school yearbook page. The governor immediately apologized but then disavowed the picture at a news conference the next day, while also acknowledging that he had put shoe polish on his cheeks later in 1984 while imitating Michael Jackson in a dance contest.

“Are you still able to moonwalk?” a reporter asked. The governor, seemingly grateful for a lighthearted question, looked to his right and left as if gauging whether there was space for a demonstration. The first lady, standing at his side, put her hand out and answered for him: “In appropriate circumstances.”

She said it quietly, so the governor repeated it: “My wife says, ‘In appropriate circumstances.’ ”

As calls for the governor’s ouster continued, the first lady was one of the surest voices advising him to stay and build on the equity work the administration had begun.

“Let’s take advantage of this terrible, difficult time to say, ‘Okay, Virginia has a problem, and what are we going to do about it?’ ” Northam recalled saying at the time. “Let’s make sure that everything we’re doing as a state is informed by this work. Let’s make sure we — if we want to talk about equity — as I always say, we need to start at the beginning, which is early-childhood education.”

Pre-K might sound like a safe domain for even the shyest political spouse. But nothing’s simple when budget dollars are involved, and Virginia Republicans had long resisted publicly funded preschool programs.

Northam met one-on-one with legislators from both parties to make the case, with a special focus on the dozens who served on the money and education committees. She learned to tailor her pitch, talking up “equity” with Democrats but “return on investment” and “vouchers” with Republicans.

“General Assembly members would run when they’d see me coming down the hallway,” she joked. But she was surprised at times to get a warm reception on pre-K and child care from some conservative Republicans.

“I had one gentleman who listened to me, an older, White gentleman‚” Northam recalled. “And then he looked at me and he said, ‘My mother ended up a single mom, and I remember having to go to Miss So-and-So’s.’ And he was quiet for a minute and he said, ‘It was not a good situation.’

“And here was someone I thought I was going to have the worst time trying to connect with about children and mothers and working and all this stuff,” she said. “And here he had that experience, very personally, coming up.”

Some usual Democratic allies, however, were not onboard at first. Northam was not merely asking for increased funding but for boosting standards and rejiggering the state’s bureaucracy. That included consolidating what she called a “crazy quilt” of pre-K programs under the Department of Education, shifting 100 staffers from the Department of Social Services.

The prospect was unsettling to child-care providers from Fairfax to Lee counties who had been used to working with DSS. But the unified approach gave Virginia more flexibility as it tapped $10 million in federal emergency educational relief funds, allowing it to expand pre-K programs to 3-year-olds during a pandemic period, when state funds were frozen.

In his final budget plan, Gov. Northam included $225.7 million in additional pre-K funds over the next two years. That would mean more than $340 million in new investments in early learning since 2018 if the plan passes as is — admittedly a big “if,” with an incoming Republican governor and a newly red House of Delegates.

It could help that there’s a funding stream already specified in state law, with 40 percent of the tax revenue from legal marijuana sales earmarked for early-childhood education. And some Republicans expect support for expanded pre-K to continue precisely because Pamela Northam worked so diligently to sell it.

“She didn’t take the easy path of just being the first lady and counting on Democratic support, but rather worked with Republicans,” Davis said. “It’s interesting to see what initiatives last and what don’t. And the ones that are shoved through in purely partisan fashion tend to be undone. And those where the extra effort’s put in to get input and buy-in from both sides tend to be the ones that stand the test of time.”