Senator Michael Bennet of Colorado, who campaigned for president on a promise to fix a broken Washington, ended his bid for the Democratic nomination on Tuesday after a dismal showing in the New Hampshire primary.

Mr. Bennet had staked all his hopes on New Hampshire, holding 50 town hall events there in the 10 weeks leading up to the primary and campaigning exclusively there in the final stretch, even on the night of the Iowa caucuses.

But early results showed him with only 0.3 percent of the vote. Write-in candidates had more.

“I feel nothing but joy tonight as we conclude this campaign and this chapter,” Mr. Bennet tweeted after announcing his departure. “Tonight wasn’t our night. But New Hampshire, you may see me once again.”