HINGHAM — Democratic residents overwhelming cast their ballots for former Vice President Joe Biden during Tuesday’s primary election, which President Donald Trump was by far the top choice for Republican voters in the town.

In Hingham, 6,823 residents filled out Democratic ballots. Of those, 2,879 voted for Biden, 1,373 voted for former New York City mayor Michael Bloomberg, 1210 voted for Massachusetts Senator Elizabeth Warren and 893 voted for Vermont Senator Bernie Sanders.

Other Democrats, including many who have dropped out of the race, won 438 votes, while 20 residents marked “no preference,” eight left that field blank and two voters wrote other candidates.

Trump earned an easy victory in the town, winning 894 votes out of 1154 Republican ballots cast. Only 179 voted for former Massachusetts governor Bill Weld, who is attempting a primary challenge against the sitting president. Nineteen residents voted for other candidates on the ballot, 39 marked “no preference,” five left that field blank and 23 wrote in candidates.

One person voted for Sedinam Kinamo Christinmoyowasifza-Curry of the Green Rainbow Party and two people wrote in candidates for that party.

Out of 17,938 registered voters, 7,985 voted, a turnout of 44.5 percent.

Records show 8,693 residents voted in the 2016 primary. Town clerk Eileen McCraken said on Tuesday the fact that Trump is an incumbent up for reelection likely meant lower turnout than during elections where both parties are choosing a candidate.

Trump cruised to an easy victory in Massachusetts, despite the primary challenge from a Massachusetts politician. With 91% of precincts reporting, he had won 87.7% of the vote. Weld trailed far behind with 9.3 percent.

Warren’s status as a Massachusetts local also did little to help her result in the state on Tuesday. With 91 percent of precincts reporting, the senator finished third in her home state with 21.2 percent of the vote. Biden was in first with 33.7 percent, and Sanders was second with 26.6%. Bloomberg, who was the second most popular Democrat in Hingham, came fourth statewide with 11.7 percent of the vote.

Massachusetts was one of 14 states, plus American Samoa, to vote in primaries on Tuesday. With more than a third of the total number of available delegates up for grabs, it was a crucial test for the six Democrats still aiming to be their party's pick to face Trump in November.

As of Monday morning, Alabama, Arkansas, Massachusetts, Minnesota, North Carolina, Oklahoma, Tennessee, Texas and Virginia had all been called for Biden, while Sanders won in California, Colorado, Utah and Vermont. Maine has not yet been called. Bloomberg won in American Samoa.

Material from the Associated Press was used in this report.