As speculation mounted in recent months about her chances of being tapped as Joe Biden’s running mate, Sen. Kamala D. Harris (D-Calif.) began introducing some eye-catching legislation.

One measure boosted research for uterine fibroids, a condition that threatens pregnancies and disproportionately affects Black women. Another toughened a measure to ban police chokeholds following the killing of George Floyd. In the same stretch, she used her Senate perch to push for greater voting access.

All those issues are of deep concern to the Black activists whose skepticism of Harris helped doom her own presidential campaign but who were gaining influence in the Democratic Party amid a season of racial reckoning. Harris turned to some of those activists, meeting with them repeatedly as she crafted the Senate provisions. And by the time Biden was in the final throes of his arduous selection process, many of the same critics who had looked with suspicion at Harris’s past work as a prosecutor were suddenly pulling for her as a fellow Black woman.

“Senator Harris has reflected that had she had the opportunity to make certain choices that she made back in the ’90s when she was the district attorney, if she had the opportunity to make those choices in the Black Lives Matter era, more than 20 years later, that may have shifted,” said Alicia Garza, co-founder of the Black Lives Matter movement.

Garza said she met with Harris recently for over an hour and discussed “some of the challenges of this moment, some of the policy that we needed to see her champion in this moment, and it was an important and a good meeting,” Garza said.

It helps, she added, that Harris suggested she might not embrace the same policies today.

The coming together of Harris and her former critics marked an extraordinary behind-the-scenes drama that played out amid the months-long speculation over who presumptive Democratic nominee Joe Biden would pick as his running mate, and whether he would choose a Black woman as many in the party were demanding, according to people familiar with the process.

Harris, back in the Senate after dropping out of the presidential primaries in December, used her legislative perch to prove her bona fides while also reaching out to activists to hold private meetings in which she sought to show that she had changed over time.

Many Black leaders, for their part, held impassioned strategy sessions and energetic discussions, eager to apply just enough pressure on Biden while also debating how strongly to push specifically for Harris.

And inside the Biden campaign’s search apparatus, when negative stories about Harris were being pushed from some fellow Californians, Black leaders pushing for Harris began feverishly reaching out to their contacts in the state to quell those concerns about her, according to a person familiar with the situation who spoke on the condition of anonymity to discuss campaign dynamics.

A Harris spokesperson declined to comment for this story.

The Biden campaign has been happy, and somewhat relieved, with Harris’s introduction. It raised an impressive $1 million an hour for the first 48 hours after announcing the ticket; that $48 million total compares favorably with the $60 million that Biden raised in all of 2019. Her initial interviews have been with Black women, including speaking to reporters working for Essence and the Grio, which are geared toward Black audiences.

Biden aides say his selection of Harris was not based on race, but rather on his comfort with her as a governing partner. At the same time, they say the candidate recognized the resonance of selecting a woman of color (Harris’s father emigrated from Jamaica and her mother from India).

“He understands the Black community, and he listens,” said Symone Sanders, a senior Biden adviser. “He knows that representation matters. He said himself that he picked Senator Harris because she was qualified — but he also said that he knows the power of seeing a Black woman who is a daughter of immigrants ready to take the second-highest office in our country for so many Black girls out there.”

The political landscape has shifted seismically since Biden in March pledged to pick a female running mate. Covid-19, the disease caused by the novel coronavirus, ravaged the country, particularly Black and Latino communities. The ensuing economic downturn also slammed minorities.

And the current racial reckoning gained momentum in May when a tape surfaced of Ahmaud Arbery’s brutal killing in Georgia surfaced, then exploded weeks later when the killing of George Floyd at the hands of police sparked days of protest.

During the primaries, Harris and Biden tangled over his early Senate record, when he opposed federally ordered busing and worked with segregationist senators.

Later, Biden had to scramble to clean up a remark he made on “The Breakfast Club,” a radio show with a large Black audience, when he told listeners that if they were considering supporting Trump, then “you ain’t black.” At another point he rebuked a Black reporter who asked him about his cognitive strength by saying, “Are you a junkie?”

Initially, it was far from clear that Harris could offset such missteps. Many activists were deeply unhappy with her tenure as a prosecutor and attorney general in California, saying she’d missed opportunities to reform the criminal justice system.

Detractors, for example, attacked her decision to criminalize the parents of truant students, saying it hardened racial disparities. Harris said that few parents were actually jailed under the policy, and that it rather allowed her office to identify families in need of assistance and help them.

When Harris released her broad criminal justice plan in September, some activists argued it should go further. At one Democratic debate, moderator Linsey Davis asked Harris why she hadn’t done more on criminal justice when she was California’s attorney general, the crowd cheered the question.

“There have been many distortions of my record,” Harris responded.

LaTosha Brown, co-founder of Black Voters Matter, said that after her presidential campaign ended, Harris made a conscious effort to reach out and tackle these issues head-on.

“She was willing to put out the olive branch and really be able to show that she was not only seeing herself as a member of the community, but was willing to work and to take some leadership and direction from that community,” Brown said.

Brown had backed Sen. Elizabeth Warren (D-Mass.) in the primaries, but she later urged Biden to pick a Black woman as his running mate, and she suggested Harris had evolved. “The bottom line is, I think that we all have an arc of leadership,” Brown said.

In the early months of her campaign, Harris struggled with how to talk about her role as a prosecutor. She opted for a slogan that played on that job — “Kamala Harris for the people” — but she simultaneously downplayed it, in part because some advisers worried it would alienate progressives.

About six months in, she pivoted, deciding to run on her record and frame it as an effort to reform a broken justice system from inside.

Now that she is the presumptive vice-presidential nominee, some allies say her greater acceptance by civil rights advocates is coming less from Harris’s overtures than from a greater understanding of where she has always stood.

Glynda Carr, co-founder of Higher Heights for America, cited Harris’s pointed questioning of Brett M. Kavanaugh during his Supreme Court confirmation hearing in September 2018. “Do I think as a leader, she’s shifted? No, because you know, she’s had these breakthrough moments,” said Carr, whose group endorsed Harris in the primaries. “Give her a hearing, and the world is like, ‘Yes! Kamala Harris!’ ”

At the same time, the moment of racial reckoning has prompted some activists to recognize what they acknowledge has sometimes been a knee-jerk distrust of prosecutors. “In our community, if you’re a prosecutor, there’s an immediate side-eye,” said Angela Rye, a former director of the Congressional Black Caucus.

As Harris became more deeply involved with police reform in the wake of Floyd’s killing, her detailed understanding of the criminal justice system was increasingly seen by activists as a plus. She went out of her way, for example, to change language in a Democratic bill that originally banned most police chokeholds but not the type used by Minneapolis police to subdue Floyd. Harris made sure that tactic was covered in the bill.

As Harris mended fences with Black activists, a group of influential African American women in Washington mobilized a campaign to pressure the Biden campaign to select a Black woman.

Moments after he pledged to select a woman on the debate stage, Donna Brazile, a powerful figure in the Democratic Party, received a text from her longtime friend and ally Melanie Campbell, head of the National Coalition on Black Civic Participation, asking her to join an effort to push for a Black running mate.

Brazile initially declined. A seasoned campaign operative herself, she did not want to dictate from the outside what a presidential campaign should do.

But later that night, she said, she thought about the campaign paraphernalia in her basement, including buttons from the 1984 Democratic presidential campaign. That year, nominee Walter Mondale made history by choosing Geraldine Ferraro as the first woman on a major presidential ticket.

Yet Brazile, who worked on that campaign, did not recall the moment fondly. “Walter Mondale considered everyone but a Black woman,” Brazile said.

The next morning, Brazile joined the effort. She and others drafted a letter to Biden’s campaign that was ultimately signed by about 200 civil rights leaders. She met with Biden and talked to members of his running mate selection committee.

By July, it was clear Biden was considering several Black women, and he reached out to ask if Brazile’s group favored one of the prospects over the others.

“There was a lot of hesitation, because we didn’t want to play that game of picking and choosing between friends,” Brazile said. “But yes, we did have to turn that corner eventually.” Brazile told Biden’s team that Harris was the top choice of many in the group.

After Biden formally announced his running mate, some analysts described Harris as a “safe” pick, which was jarring to many of those who pushed for her.

“Really? When did we ever have a Black woman nominee? How is that safe?” Campbell said. “I can say the decision was not just historic, but game-changing.”

But Garza said her support for Harris is conditional.

“Now that there is this level of representation on the ticket, that is expected to translate into substance,” Garza said. “I can already tell you that there are going to be some fights.”