The race between New Jersey Senate President Steve Sweeney and a little-known candidate backed by the state's largest teachers' union was likely the most expensive state legislative election in U.S. history, a watchdog group found.

Total spending by the candidates and independent political groups reached an estimated $18.7 million in South Jersey's Third Legislative District race, according to the New Jersey Election Law Enforcement Commission (ELEC).

The second most expensive legislative race ($16.5 million) was a 2000 state Senate contest in California, according to data compiled by the National Institute on Money in State Politics and analyzed by ELEC.

An outside political group affiliated with the New Jersey Education Association spent an estimated $4.8 million in an unsuccessful effort to defeat Sweeney (D., Gloucester), ELEC found.

Sweeney, the state's top-elected Democrat, beat Republican Fran Grenier by a whopping 18 percentage points.

Sweeney's candidacy was backed by multiple super PACs. New Jerseyans for a Better Tomorrow, a super PAC founded by a former Sweeney aide, spent $5 million, according to ELEC – the most of any group.

"The amount spent on the third legislative district alone this year is staggering. It is more than most past gubernatorial candidates have spent statewide," said Jeff Brindle, executive director of ELEC, the state's campaign-finance regulator.

The teachers' union tends to support Democratic candidates. But the union accused Sweeney of cutting too many deals with Republican Gov. Christie and breaking a promise to hold a vote on a proposed constitutional amendment to mandate pension funding for public workers.

Sweeney accused the group of attempting to extort senators. He was reelected Senate president by his colleagues last month.

About $36 million was spent in the gubernatorial race between Democratic Gov.-elect Phil Murphy and Republican Kim Guadagno, according to ELEC.

All 120 seats were up for election in the Legislature, which is controlled by Democrats. Spending in all legislative races totaled $56 million.