Vice President Kamala Harris has secured the Democratic nomination for president, becoming the first woman of color to win a major party’s nomination and officially setting up her matchup against former President Donald J. Trump.

Ms. Harris, 59, earned the support of 99 percent of the 4,567 delegates who cast ballots, the Democratic National Committee said in a statement late Monday. In an unusual move meant to avoid potential legal headaches, the roll call was held virtually over five days, instead of in-person at the Democratic National Convention, which begins on Aug. 19 in Chicago.

The convention’s secretary, Jason Rae, must certify the results of the roll call before Ms. Harris and her soon-to-be-announced running mate accept the nomination.

“Vice President Harris has historic momentum at her back as we embark on the final steps in officially certifying her as our party’s nominee,” Jaime Harrison, the D.N.C. chair, and Minyon Moore, the convention chair, said in a statement.

Ms. Harris, whose mother was an immigrant from India and whose father is from Jamaica, would be the first Black woman and first person of South Asian heritage to hold the office. Ms. Harris landed at the top of her party’s ticket after President Biden withdrew from the race on July 21 under pressure from his party and cleared a path for Ms. Harris’s ascent.

In the two weeks since, the party has rushed to align behind her, retooled its message, raised millions and tried to harness a swell of enthusiasm for its new candidate. Ms. Harris has conducted a fast search for a running mate and brought on a slate of new advisers to her campaign.

Typically, candidates lock in the nomination at an in-person roll call vote held at the convention with much fanfare. But this year, the party held the unusual online vote to ensure it made state deadlines for printing ballots, it said. The virtual roll call began Thursday morning. By Friday afternoon, Ms. Harris — the only candidate on the ballot — had clinched a majority of the delegates she needed for the nomination. Voting concluded on Monday at 6 p.m. The party announced the results just before midnight.

Ms. Harris first ran for president in 2019, while in her third year as a senator from California. In a crowded field of Democrats, she struggled to find her message, tangled with staff members and dropped out before voting began. Now Ms. Harris is setting out to prove she can lead a party desperate to block Mr. Trump’s attempt to return to office.

On Tuesday, Ms. Harris is expected to announce her running mate before holding a joint campaign rally in Philadelphia and then touring the battleground states.