Updated

Former state Sen. Mike Dunleavy won Alaska's Republican gubernatorial primary on Tuesday, topping a crowded field and setting the stage for what is expected to be a close contest in November.

Dunleavy will take on Democratic former U.S. Sen. Mark Begich and incumbent Gov. Bill Walker, an independent, in November. Walker has led the Last Frontier state since 2014.

While he initially ran in the Republican primary in the 2014 race, Walker eventually became an unaffiliated candidate. He opted to bypass the primaries and instead gather signatures to appear on the November ballot.

Fox News has ranked the general gubernatorial election a tossup.

Dunleavy is a former educator who worked in Alaska as a teacher, principal and superintendent. Originally from Pennsylvania, he also served in the state Senate, stepping down in January to announce his gubernatorial bid.

He has said he plans to tackle the growing crime rate in Alaska as well as grow the economy and work on the unemployment rate. He’s often criticized Walker’s work to change the permanent fund -- which pays dividends to Alaskans who have resided in the state for a full year and do not plan to leave -- as a way to balance the state budget.

“It wasn’t broken, and it didn’t’ need to be fixed,” Dunleavy told The Cordova Times.

MORE ON THE THREE GOP CANDIDATES WHO COMPETED IN TUESDAY'S PRIMARY

Dunleavy prevailed over several opponents, including a fellow frontrunner, former Lt. Gov. Mead Treadwell.

On the Democratic side, Begich ran unopposed. He had cast himself as the only gubernatorial candidate who supports abortion rights for women. He also has called for protecting in the state constitution the check Alaskans receive annually from the state's oil-wealth fund.

Alaska's Democratic Party changed its rules to let independent candidates run in its primaries. Walker flirted with doing so but opted to avoid a head-to-head primary with Begich and instead gather signatures to appear on the general election ballot.

Walker wanted to run as a team with his Democratic lieutenant governor, Byron Mallott.

Fox News' Kaitlyn Schallhorn and The Associated Press contributed to this report.