BOSTON (AP) — Massachusetts Republicans are weighing which candidate has the best chance of keeping the governor’s office in GOP hands as they vote in Tuesday’s primary: a former state lawmaker endorsed by Donald Trump or a political newcomer who’s cast himself as the more moderate choice.

Geoff Diehl and Chris Doughty are vying for the chance to replace incumbent Republican Gov. Charlie Baker, who’s opted not to seek a third term.

Democrats have a simpler decision. Attorney General Maura Healey — she would become the first woman and first openly gay candidate elected governor if she wins — is facing no challengers after the only other Democrat on the ballot dropped out of the running.

Republican voters in the state will become just the latest to decide whether the party will further embrace Trumpism or is ready to move back toward the center. In recent primaries in other blue states like Maryland and Connecticut, GOP voters have nominated Trump loyalists, hurting the party’s chances of winning against a Democrat in the November general election.

Diehl, the favorite among state Republican Party delegates in Massachusetts, has ties to Trump stretching to 2016, when he served as co-chair for Trump’s presidential campaign in the state. Trump lost Massachusetts by almost 30 percentage points in his two presidential campaigns. Diehl has also opposed COVID-19 protocols and hailed the Supreme Court ruling overturning Roe v. Wade.

Doughty, a businessman, said he supported some of Trump’s initiatives but wants to focus on challenges facing Massachusetts, which he said is increasingly unaffordable.

Diehl has come to embrace Trump’s false claims that he won the 2020 election. Diehl said last year that he didn’t think it was a “stolen election” but later said the election was rigged, despite dozens of courts, local officials and Trump’s own attorney general saying the vote was legitimate. Doughty, meanwhile, has said he believes President Joe Biden was legitimately elected.

The challenge for both is that support of Trump may play well among the party’s conservative wing but could be a political albatross in a state where registered Republicans make up less than 10% of the electorate compared to about 31% for Democrats and about 57% for independents.

Diehl faced a similar struggle when he challenged Democratic U.S. Sen. Elizabeth Warren in 2018. He won a three-way Republican primary only to capture just over a third of the vote in the general election.

Doughty said he would work to lower taxes and has said that although he considers himself “pro-life,” he accepts the state Supreme Court decision recognizing a right to abortion in Massachusetts.

Doughty has reported raising nearly $2.3 million for his campaign, most of it coming out of his own pocket, compared with Diehl, who has raised about $582,000. Healey has the largest campaign bank account — about $3.4 million.

Massachusetts has a history of electing fiscally conservative, socially moderate Republican governors — including former Govs. William Weld and Mitt Romney — to provide a check on overwhelming Democratic legislative majorities. Baker, another Republican in that mold, has remained popular in the state.

The election also features several statewide contested Democratic primaries, including for attorney general and secretary of the commonwealth.

Two Democrats are jockeying for the top law enforcement office: former Boston City Councilor Andrea Campbell and workers’ rights attorney Shannon Liss-Riordan. A week before the election, a third candidate, former assistant attorney general Quentin Palfrey, announced he was suspending his campaign and endorsed Campbell; he will remain on the ballot.

Campbell would be the first Black woman to hold the office in Massachusetts if elected.

The winner will face Republican Jay McMahon, a trial attorney who previously ran against Healey and lost.

Incumbent Democratic Secretary of the Commonwealth William Galvin is vying for an eighth term in office. He’s fielding a challenge from fellow Democrat Tanisha Sullivan, president of the Boston branch of the NAACP. Sullivan would be the first Black person to serve in that post in the state.

The winner will face Republican Rayla Campbell in November. Campbell is also Black.

There are also contested races in the Democratic primary for auditor and for the Democratic and Republican races for lieutenant governor.

None of the state’s nine incumbent Democratic U.S. House members is facing primary challengers. There are two contested Republican primaries in the 8th and 9th congressional districts.

A new state law makes “no excuse” mail-in ballots and early voting permanent fixtures in Massachusetts elections. Many of the voting options included in the new law were implemented during the height of the coronavirus pandemic and proved popular.