ALBUQUERQUE (AP) — A costly fight for control of the Legislature comes to an end Tuesday as voters decide whether Republicans will gain a majority in the House for the first time in nearly 60 years and top Democratic Senate leaders can survive efforts by GOP Gov. Susana Martinez to oust them.

The first-term governor, who wasn't up for re-election this year, used her political popularity and fundraising muscle to aid Republican candidates across the state and potentially transform legislative elections into a referendum on her policies, including a proposal to stop New Mexico from issuing driver's licenses to illegal immigrants.

Victories for governor-backed candidates could give Martinez more GOP support in the Legislature and possible clout in pressuring Democrats in the House and Senate to agree to her legislative agenda.

GOP and Democratic-leaning political action committees have dumped more than $3 million into the general election campaign, an unprecedented amount for legislative races in New Mexico.

All 112 seats in the House and Senate are up for election this year, but there were only 57 contested legislative races on the general election ballot. Some legislative seats were decided in the June primary and a number of candidates never drew an opponent.

Democrats hold a narrow 36-33 advantage in the House, where there also is one independent. Republicans haven't held a majority in the House since the 1953-1954 Legislature.

Democrats have a comfortable 28-14 edge in the Senate, but the GOP hopes to narrow the gap. Martinez also has campaigned aggressively to defeat Senate Majority Leader Michael Sanchez, D-Belen, and Senate President Pro Tem Tim Jennings, a Roswell Democrat. The governor views the Democratic leaders as a main obstacle to her legislative proposals. Jennings and Sanchez opposed the governor's driver's license measure, which has failed in the Senate after passing in the House with some Democratic support.

No other New Mexico governor has tried to influence as many races in recent elections and defeat so many lawmakers of the opposing party.

A political action committee run by the governor's political adviser targeted two dozen races and has spent $1.8 million in the general election campaign, with much of that for hard-hitting television ads and mailings. A Democratic-leaning PAC countered GOP efforts by spending more than $1.3 million.

New Mexico and Washington are the only two states currently granting illegal immigrants the same driver's licenses as a U.S. citizen. Utah allows immigrants to obtain a driving permit that can't be used for identification.