The Republican Party may still have some life in New Jersey.

Two years after the election of Democratic Gov. Phil Murphy and one year after a blue wave swept across the Garden State’s congressional delegation, Republicans were poised to gain as many as four seats in the state Assembly and flip a South Jersey state Senate seat from blue to red in Tuesday’s legislative elections.

The GOP’s Assembly leader, Jon Bramnick, may have avoided being ousted from office, as well. And Republicans were on track to hold on to their Assembly seats in two other suburban districts that Democrats were hoping to steal.

The results aren’t official. The Associated Press said late Tuesday that many key races, including Bramnick’s, were too close to call.

Republicans led in five closely watched elections — in the 1st, 2nd, 8th, 21st, and 25th districts — with most votes having been counted as of 11 p.m., according to the AP.

But it’s possible the results from provisional and late mail-in ballots could determine the final tallies.

Murphy told Democratic supporters in Somerville that results remained on a “knife’s edge” and it might be days before all votes are counted.

This was a relatively quiet election year in New Jersey, with Assembly seats and one special state Senate race topping the ticket. Only about 20 to 25 percent of the state’s registered were voters expected to cast ballots.

If results hold, Democrats would still control both houses of the state Legislature, the body that crafts New Jersey’s laws and helps decide how taxpayer money is spent in the state budget.

But they would drop from holding 26 of the 40 seats in the Senate, the upper house, to 25.

And they would go from holding 54 of the 80 seats in the Assembly, the lower house, to 50.

Democrats’ current majority in the Assembly is their largest since 1978. And they were hoping to flip a few traditionally Republican suburban districts, thanks to recent surges in registered voters, the Jersey backlash against Republican President Donald Trump, and any lingering aftershock of Republican former Gov. Chris Christie.

Republicans, meanwhile, painted Tuesday’s elections as a referendum on Murphy’s first two years as governor, calling them the “Murphy midterms" and calling him out for raising some state taxes.

If Republicans do gain four seats, they’d restore their losses from four years ago, halfway through Christie’s second term.

In Tuesday’s closest race, Bramnick, the Assembly minority leader, declared that he fended off fierce challenges from Democratic and independent candidates in North Jersey’s 21st District and avoid becoming the first top state legislative leader to be ousted at the ballot box in New Jersey since 1993.

Meanwhile, Republican challenger Mike Testa appeared to best Democratic incumbent Bob Andrzejczak for the fill the final two years of the state Senate seat in South Jersey’s 1st District that was vacated after Democrat Jeff Van Drew moved up to the U.S. House of Representatives last year.

Republicans also were poised to flip the two Assembly seats in the 1st district, and could take both seats in the neighboring 2nd district.

Those would be losses for South Jersey’s powerful Democratic bloc, which often battles Murphy for party dominance.

Overall, the results are hardly a red wave, but they at least stop the Republicans’ bleeding in Jersey, where Democrats control the governor’s office, Legislature, both U.S. Senate seats, and 11 of its 12 U.S. House seats.

“Republicans in New Jersey won’t be shouted into a corner," state GOP Chairman Doug Steinhardt said in a statement. “We pushed back Phil Murphy’s blue wave.”

Here’s how the most competitive legislative races shook out Tuesday:

STATE SENATE

Testa, an attorney, was on pace Tuesday night to oust Andrzejczak in one of New Jersey’s most purple districts, located at the very bottom of the state. That would give Republicans back the seat Van Drew flipped from red to blue 12 years ago.

Andrzejczak, a former member of the Assembly, was appointed last year to temporarily replace Van Drew.

STATE ASSEMBLY

In South Jersey’s 1st District, Republicans Antwan McClellan, an Ocean City councilman, and Erik Simonsen, mayor of Lower Township, were leading Democratic incumbents R. Bruce Land and Matthew Milam.

In South Jersey’s 2nd District — home to Atlantic City — Republicans Phil Guenther, a former Brigantine mayor, and John Risley, an Atlantic County freeholder, were leading Democratic incumbents Vince Mazzeo and John Armato.

In South Jersey’s 8th District, Republican incumbent Ryan Peters and running mate Jean Stanfield, a former Burlington County sheriff, were leading Democratic challengers Gina LaPlaca and Mark Natale and independent candidate Tom Giangiulio. Democrats were hoping to swing the suburban district blue after former Republican state Sen. Dawn Marie Addiego switched parties last year.

In the Shore’s 11th District, Democratic incumbents Joann Downey and Eric Houghtaling were leading in their quest to win a third term against Republicans Matt Woolley and Mike Amoroso.

In Central Jersey’s 16th District, Democratic incumbents Andrew Zwicker and Roy Freiman were leading Republicans Mark Caliguire and Christine Madrid.

In North Jersey’s 21st district, Bramnick and longtime Republican district mate Nancy Munoz were leading as they attempted to stave off a tough, well-funded challenge from Democrats Lisa Mandelblatt and Stacey Gunderman, as well as from “independent conservative" candidates Martin Marks and Harry Pappas.

In North Jersey’s 25th district, Republican incumbent Anthony M. Bucco and running mate Brian Bergen leading as they tried to fend off a tough challenge from Democrats Darcy Draeger and Lisa Bhimani. But if Bucco does win, he won’t serve. He was recently chosen to move up to the state Senate after his father, Anthony R. Bucco, died, and Republicans would pick someone else to replace him in the Assembly.

None of these close races were called by the AP.

INCUMBENTS AND NEW FACES

All other incumbents won re-election to the Assembly.

Others elected to open Assembly seats included:

Democrat William Moen, an aide to U.S. Sen. Cory Booker , won the seat currently held by retiring Democrat Patricia Egan Jones in South Jersey’s 5th District.

Republican John Catalano, a former Brick councilman, won the seat currently held by retiring Republican David Wolfe in the Shore’s 10th District.

Republican Gerard Scharfenberger, a Monmouth County freeholder, won the seat currently held by retiring Republican Amy Handlin in the Shore’s 13th District.

A DEEPER LOOK

Demographics have been shifting left in New Jersey of late, with registered Democratic voters now out-numbering registered Republican voters by nearly 1 million — three times their advantage just 12 years ago.

Plus, Democratic candidates out-raised Republican contenders nearly 3 to 1.

Had the Democrats gained only one seat, they would have had their largest grip on the Assembly since 1975, when Watergate had decimated the Republican Party.

Murphy’s team noted that Democrats did flip a number of local seats Tuesday, including the mayor’s office in Dumont, Hamilton, and Bergenfield.

“The party’s never been in a better place,” the governor said.

And Murphy supporters hinted that some Democrats may have lost because they didn’t embrace the governor’s progressive policies. For instance, Democrats in the split 1st and 2nd districts, fo often distanced themselves from Murphy.

Looks like disavowing progressive policies and running towards the center isn’t a winning strategy for New Jersey Democrats. — Pass the Millionaires Tax (@L_DiPaolo) November 6, 2019

But Bramnick said Tuesday’s elections showed Murphy’s “honeymoon is over.”

“It’s not about Donald Trump. It’s not about Chris Christie. It’s about Phil Murphy,” the Assembly Republican leader told NJ Advance Media.

NJ Advance Media staff writers Matt Arco and Blake Nelson contributed to this report.

Click here for complete New Jersey election results.

Brent Johnson may be reached at bjohnson@njadvancemedia.com. Follow him on Twitter @johnsb01.

Have a tip? Tell us. nj.com/tips

Get the latest updates right in your inbox. Subscribe to NJ.com’s newsletters.