Ms. Gabbard, 38, announced late last year that she would not seek re-election to Congress in the fall.

She campaigned for president on a noninterventionist foreign policy, denouncing “regime-change wars” and the idea of the United States as the world’s police. She said her own deployments — she served two tours of duty in the Middle East as a member of the National Guard — had taught her the costs of war firsthand.

“We should be coming to other leaders in other countries with respect, building a relationship based on cooperation rather than with, you know, a police baton,” she said last year.

Her unorthodox platform, a mix of noninterventionist foreign policy, liberal social policy and libertarian leanings on issues like drug decriminalization, attracted support from an unusual array of public backers. Alt-right internet stars, white nationalists, libertarian activists and some of the biggest boosters of Mr. Trump heaped praise on Ms. Gabbard.

Many Democrats were far more skeptical of her effort, at a loss to explain her frequent appearances on Fox News, favorable coverage in Russian state media and an ideology that both argued for getting out of foreign wars and refused to strongly condemn some autocratic leaders.

A public fight with Hillary Clinton brought attention and fund-raising dollars, keeping Ms. Gabbard on the primary debate stage and attracting some support from independent and Republican voters, particularly in libertarian-leaning New Hampshire.

Ms. Gabbard was once seen as a rising star in the Democratic Party, even as she sometimes defied it.

Her progressive economics and noninterventionist foreign policy seemed like obvious attractions for Democrats, her military résumé gave her extra credibility, and she broke barriers as the first Hindu and the first American Samoan elected to Congress. So it was not surprising when she entered the presidential race last January, even though no sitting representative has been elected president in 140 years.