Candidates, state and county campaign committees and independent groups spent more than $7.1 million on last month’s special election to fill the State Senate seat of former Majority Leader Dean Skelos, according to state Board of Elections records.

New filings show that supporters of winner Todd Kaminsky, a Long Beach Democrat, and Republican Christopher McGrath of Hewlett poured $7,136,173 into the April 19 contest in the 9th Senate District.

The Senate Republican Campaign Committee reported nearly $772,000 in direct expenditures on items such as polling and mailers to benefit McGrath.

The Senate Democratic Campaign Committee spent more than $687,000 for Kaminsky, according to 27-day postelection filings that were due Monday at midnight.

The Nassau County Democratic Committee spent almost $535,000 backing Kaminsky and the Nassau Republican Committee spent nearly $59,000 for McGrath.

Independent groups unaffiliated with the campaigns including StudentsFirst, a pro-charter school group, combined to spend an additional $1.64 million, largely to benefit McGrath.

The massive spending illustrated the importance both parties placed on the outcome of the special election, which was considered critical in determining control of the Senate.

advertisement | advertise on newsday

Democrats outnumber Republicans in the Senate, but the GOP maintains control with a coalition of six breakaway Democrats.

“Chris McGrath and his anti-reform allies in Albany did everything they could to buy the election,” said Kaminsky spokesman Evan Thies. “Clearly, the enemies of reform will stop at nothing to protect the status quo.”

Senate Republican spokesman Scott Reif said “we will continue to use whatever resources are necessary to remind people of the dangers of turning our entire state government over to Mayor de Blasio and the New York City Democrats.”

The campaign finance reports show that both campaigns received large cash infusions in the final days of the race.

Three Democratic committees transferred a total of $706,000 to Kaminsky’s campaign between from April 6 to April 18: $442,000 from the State Senate Democratic Committee; $253,000 from the Nassau Democratic Committee and $11,000 from the State Democratic Committee.

Kaminsky raised another $218,000 in the campaign’s final days, including $5,000 from director Mel Brooks, Kaminsky’s great-uncle, and $11,000 from Gov. Andrew M. Cuomo.

Kaminsky spent nearly $800,000 on television ads in the last two weeks of the race, filings show.

The Senate Republican Campaign Committee transferred $243,700 to McGrath’s campaign between April 8 and April 14, records show.

McGrath raised another $95,000 in the campaign’s final two weeks, including $10,000 from the Nassau Police Benevolent Association.

McGrath’s campaign spent more than $442,000 on TV ads during the two weeks of the election, records show.

advertisement | advertise on newsday

Over the entire campaign, the Senate Republican Committee transferred more than $1 million to McGrath while Democratic committees gave $960,000 to Kaminsky.

Kaminsky ended the campaign with about $58,000 in the bank while McGrath had $47,000 available, records show.

Skelos (R-Rockville Centre) lost the seat after he was convicted with his son, Adam, in December on eight federal counts of bribery, extortion and conspiracy. Dean Skelos was sentenced to 5 years in prison and Adam Skelos to 6 1⁄2 years. They are appealing their convictions.