Massachusetts Sen. Ed Markey faces younger, more moderate primary challenger in Rep. Seth Moulton

Massachusetts will also have primaries for several House races and governor.

Massachusetts voters will decide Tuesday whether to nominate Sen. Ed Markey for another six years in Congress, or whether the 80-year-old progressive should be replaced as the Democrat on the general election ballot with a 47-year-old Marine Corps veteran who is a member of the moderate New Democrat Coalition.

In one of the country's most liberal states, the race between Markey and Rep. Seth Moulton is expected to be a test of whether a generational argument is enough to convince voters to unseat a longtime incumbent when the challenger is not as left leaning.

Markey, who first went to Washington as a House member in 1976 and has been a senator since 2013, is being supported by Rep. Alexandra Ocasio-Cortez as well as Sens. Bernie Sanders and Elizabeth Warren.

Moulton rose to prominence in 2018 after unsuccessfully attempting to block Nancy Pelosi from regaining her position as speaker of the House. At the time, he also argued that it was time for a new generation of leadership.

"He likes to roll the dice," Raymond La Raja, a political science professor at the University of Massachusetts Amherst, told ABC News. "He even ran for president at one point. And here's another instance of him rolling a dice against an incumbent in this Senate race."

While Markey and Moulton agree on many issues, such as abolishing U.S. Immigration and Customs Enforcement (ICE), Moulton has placed the generational divide between him and Markey at the center of the Senate primary race.

"We need the generation that grew up with the internet and is going to have to live for decades with the consequences of AI to chart the way forward," Moulton said during a debate in August hosted by ABC affiliate WCVB.

Markey said he has been the leader on internet and artificial intelligence safeguards. In March, he introduced the Youth AI Privacy Act.

"I just want to say it doesn't make any difference whether it's called 'Siri' or it's called 'Claude,'" Markey said during the debate while emphasizing the need for widespread protections.

Moulton responded, "How are we going to effectively regulate and keep big tech accountable if you can't even tell the difference between big tech programs?"

Rachael Cobb, an associate professor of political science at Suffolk University in Boston, told ABC News that while Moulton is trying to make his understanding of technology a focus of his campaign, his base remains Democrats who are on the more moderate end of the party.

"Those kinds of things that happen in debates do not change the outcome of an election generally, especially when the polling is so wide between the two of them," Cobb said.

Polling released last week by the University of New Hampshire found that 63% of likely Democratic supporters supported Markey, with 28% backing Moulton.

This is not the first time that Markey has faced a younger Democratic primary challenger. Six years ago, the senator defeated Rep. Joe Kennedy III.

Incumbent moderate Democrats running in primary races around the U.S. have been facing tough challenges from younger, more progressive candidates for nearly a decade, from Ocasio-Cortez defeating Rep. Joe Crowley in New York in 2018 to Rep. Diana DeGette losing her Colorado primary this past June to democratic socialist Melat Kiros.

In Massachusetts, the Democratic Senate primary is one of several races taking place Tuesday.

In the 8th Congressional District in Boston and some of its South Shore suburbs, longtime moderate Democratic Rep. Stephen Lynch is being challenged by Patrick Roath, a progressive attorney.

North of the city, half a dozen candidates are seeking the Democratic nomination for Moulton's soon-to-be-former seat in the 6th Congressional District.

In the 1st Congressional District primary in western Massachusetts, Democratic Rep. Richard Neal, who has been in Congress since 1989, is running against teacher Jeromie Whalen.

The most prominent Republican race on the ballot Tuesday is the gubernatorial primary. Voters will decide whether Mike Minogue or Brian Shortsleeve, each veterans with significant business experience, will be the Republican nominee to take on Democratic Gov. Maura Healey, who is running unopposed in the Democratic primary, in November.

Early voting in Massachusetts concluded last Friday. Polling places are open Tuesday until 8 p.m.