TRENTON, N.J. — An incumbent New Jersey Republican state senator who sponsored a bill that included a 23-cent gas tax hike has emerged victorious in his primary contest.

State Sen. Steven Oroho defeated William Hayden, of Branchville, in the 24th Legislative District on Tuesday.

It was one of several contested races as voters went to the polls to elect Democratic and Republican candidates for November’s gubernatorial and legislative election.

Oroho was a co-sponsor last year of legislation that established an eight-year $16 billion transportation trust fund and cut the sales and estate taxes. The legislation also hiked the gas tax by 23 cents. Hayden, a transportation department staffer, used “Remember the Gas Tax” as his slogan and said he opposed the hike.

There were contests in eight state Senate and 15 Assembly races overall. None of the incumbents up for re-election lost.

Voters will elect a new 120-member Legislature in November. New Jersey’s 40 legislative districts each include two Assembly members and one state senator, and Democrats currently control both chambers.

Voters on Tuesday also selected candidates in the statewide contest for governor to replace the term-limited Republican incumbent Chris Christie. Wealthy former Goldman Sachs executive Phil Murphy won the Democratic nomination, while Christie’s top deputy, Lt. Gov. Kim Guadagno, got the GOP nod in the battle to replace the unpopular governor.

None of the Democratic or Republican parties’ top leaders faced primary challenges on Tuesday. In some of the contested races, the campaigns are among candidates of the party that has traditionally failed to win the general election.