Senator Cory Booker of New Jersey dropped out of the Democratic presidential race on Monday, ending a nearly yearlong quest built around a message of peace and unity that failed to resonate with voters eager for a more aggressive posture against President Trump. The departure of Mr. Booker, 50, from the crowded Democratic field, heralded at the outset as the most diverse in history, leaves just one African-American candidate, Deval Patrick, vying for the nomination in a party where black voters are an essential bloc of the Democratic base.The decision came after Mr. Booker, who never cracked the top tier of Democratic contenders and consistently polled in the low single digits, fell short of qualifying for a second consecutive debate. The setback, the Booker campaign conceded in the past few weeks, would most likely doom the underdog candidacy at a time when the Democratic race for president is being overshadowed by an impeachment trial in Washington and a growing conflict with Iran.“I got in this race to win, and I’ve always said I wouldn’t continue if there was no longer a path to victory,” Mr. Booker said in a statement to supporters. “Our campaign has reached the point where we need more money to scale up and continue building a campaign that can win — money we don’t have, and money that is harder to raise because I won’t be on the next debate stage and because the urgent business of impeachment will rightly be keeping me in Washington.”Mr. Booker, who is also up for re-election to the Senate this year, still enjoys favorable ratings in New Jersey, which leans decidedly Democratic and hasn’t elected a Republican senator in more than 40 years. Senator Robert Menendez won re-election there by nearly 10 percentage points in 2018 after weathering a federal corruption trial. Mr. Booker often made his case for the presidency through his biography: as a black man whose family had to overcome racist housing discrimination in New Jersey; as a mayor of a majority black city who saw the uneven impact of hard-line criminal justice laws and the scourge of gun violence as a daily menace in his community. Yet he also never attracted substantial support from black voters, many of whom view mere representation as not enough to lock down support.Mr. Booker began his campaign last Feb. 1, the first day of Black History Month, with a clarion call for unity in a deeply polarized time. Throughout his campaign, he was unrelenting in his optimism and his calls for love and healing, a message that apparently fell flat with an electorate energized by a fervent dislike of Mr. Trump.Though the core of his campaign was built on emotional ideals, Mr. Booker focused heavily on policies that deeply affected cities like Newark, where he was mayor for seven years. He pledged to offer sweeping clemency to thousands of nonviolent drug offenders, and he pushed some of the other Democratic candidates to embrace more aggressive stances on gun control, becoming the first candidate in the field to propose a national gun licensing program. And he focused constantly on addressing the racial wealth gap, including an economic proposal known as baby bonds that would create a government-run savings account for every child born in the United States.He cast himself as the candidate best suited to rebuild the “Obama coalition,” and his campaigning took him beyond the rotation of the four early primary and caucus states to key swing-state cities like Detroit, Philadelphia and Miami. His argument was based in a general election narrative, that in order to defeat Mr. Trump, Democrats needed to revive the massive turnout in cities to offset Mr. Trump’s rural appeal. But Mr. Booker was never able to attract the support of black voters in both national polling and key early states like South Carolina, who were either supporting former Vice President Joseph R. Biden Jr. or looking at more progressive candidates. As Mr. Booker held up his identity and lived experience as a rationale for his candidacy, he proved unable to bridge a party split more along ideological lines between the moderate and progressive wings. Nonetheless, Mr. Booker seemed to confound supporters, donors and pundits who remained mystified about why he never had his “moment” during the primary. He started his campaign with a limited base of online donors and a heavy reliance on traditional big-dollar fund-raisers. Without ever experiencing the kind of surge in support that could have led to a surge in online fund-raising, Mr. Booker was forced to run a shoestring campaign, unable to finance the frequent television advertising that has helped candidates like Tom Steyer become mainstays on the debate stage.Mr. Booker, despite years of relationships in the finance world of New York and the high-tech corridors of California, had struggled to raise money throughout 2019. All told, he collected about $22.1 million — less than Senator Bernie Sanders of Vermont, Mr. Biden or former Mayor Pete Buttigieg of South Bend, Ind., raised just in the fourth quarter.Money was so tight that Mr. Booker had scheduled fund-raisers in the final two-week sprint of his campaign in California and New Jersey — far from the crucial battlegrounds of Iowa and New Hampshire.Mr. Booker had not invested heavily in a digital donor program in advance of his run and he never successfully turned on the spigot of small, grass-roots contributions like some of his rivals. Entering October, he had raised only $4.3 million from donations of less than $200; less than the total haul, for instance, of Mr. Sanders in his first 24 hours as a candidate.Still, he had an enviable stable of more than 100 bundlers who are now up for grabs, including the billionaire Donald Sussman, one of the Democratic Party’s most generous donors.In a final push to inch up in Iowa polling and make the January debate stage, Mr. Booker’s campaign ran roughly $300,000 in television ads in Iowa in the past two weeks, a modest sum in a race dominated by the millions spent on the airwaves by Mr. Steyer and former Mayor Michael R. Bloomberg of New York. The ads pushed Mr. Booker’s advertising budget to its limit.And he struggled to shine as a unique political figure in a crowded and diverse field. His résumé, which had drawn national attention for its breadth throughout his career, was matched at every point. A Rhodes Scholar and former mayor? That also applied to Mr. Buttigieg. The first black person to be elected senator from his state? That also applied to Senator Kamala Harris of California.Though his departure from the race is unlikely to have much of an impact on other candidates’ polling, the Booker campaign was a leader in endorsements in Iowa and New Hampshire and had a particularly notable staff of Iowa organizers, setting up a likely scramble by the remaining candidates to secure both endorsers and staff members in the early nominating states. Nearly all of the remaining Democratic candidates praised the campaign Mr. Booker ran, and on Monday many shared photographs of Mr. Booker offering them a hug or posing for a selfie with a voter. Mr. Biden said Mr. Booker had “campaigned with joy and heart.” Andrew Yang, who formed a personal friendship with Mr. Booker on the campaign trail and regularly exchanges text messages with the senator, said he will miss seeing Mr. Booker (and his girlfriend, the actress and activist Rosario Dawson) on the trail. “You’ve always been a powerful voice for justice and equality, and you’ve made this primary stronger,” said Senator Elizabeth Warren of Massachusetts. In a video message released Monday, which was backed by a gospel-like piano track and drumbeat and featured a greatest-hits rundown of his message on the campaign trail, Mr. Booker was upbeat until the end.“So now I recommit myself to the work,” Mr. Booker said. “I can’t wait to get back on the campaign trail and campaign as hard as I can for whoever is the eventual nominee and for candidates up and down the ballot.”Mr. Booker also showed a touch of humor on Monday. When a celebrity gossip website published an article noting that Mr. Booker’s exit had fans mourning the possibility of Ms. Dawson becoming first lady, Mr. Booker responded on Twitter, his favorite medium.“Have you been talking to my mom?” he said. Shane Goldmacher contributed reporting.