MANCHESTER, N.H. (AP) — Bernie Sanders won New Hampshire’s presidential primary Tuesday night, edging moderate rival Pete Buttigieg and scoring the first clear victory in the Democratic Party’s chaotic 2020 nomination fight.

In his win, the 78-year-old Sanders, a self-described democratic socialist, beat back a strong challenge from the 38-year-old former mayor of South Bend, Indiana. The dueling Democrats represent different generations, see divergent paths to the nomination and embrace conflicting visions of America’s future.

As Sanders and Buttigieg celebrated, Amy Klobuchar scored an unexpected third-place finish that gives her a road out of New Hampshire as the primary season moves on to the string of state-by-state contests that lie ahead.

Elizabeth Warren and Joe Biden posted disappointing fourth and fifth place finishes respectively and were on track to finish with zero delegates from the state.

Sanders and Buttigieg were on track to win the same number of New Hampshire delegates with most of the vote tallied, with Klobuchar a few behind. Warren, Biden and the rest of the field were shut out, failing to reach the 15% threshold needed for delegates.

The AP allocated nine delegates each to Sanders and Buttigieg and six to Klobuchar.

The action was on the Democratic side, but Trump easily won New Hampshire’s Republican primary. He was facing token opposition from former Massachusetts Gov. Bill Weld.

With most of the vote in, Trump already had amassed more votes in the New Hampshire primary than any incumbent president in history. His vote share was approaching the modern historical high for an incumbent president, 86.43% set by Ronald Reagan in 1984. Weld received about 9% of the vote of New Hampshire Republicans.

The political spotlight quickly shifts to Nevada, where Democrats will hold caucuses on Feb. 22. But several candidates, including Warren and Sanders, plan to visit other states in the coming days that vote on Super Tuesday, signaling they are in the race for the long haul.