New Mexico's U.S. Senator-elect, Martin Heinrich (D), speaks to supporters after declaring victory in his race on Tuesday, Nov. 6. Environmentalists spent nearly $2 million attacking his opponent, Heather Wilson (R), for her ties to the oil and gas industries. (Craig Fritz/AP)

For years, environmentalists have been seen as marginal players in presidential and congressional elections.

That may have changed last week.

The environmental community scored a string of successes Tuesday in New Mexico, Montana, Texas and other states, winning seven of eight targeted Senate races and at least threetargeted House races. Although plenty of outside groups poured money into these contests, even some representatives of the fossil-fuel industry said that environmentalists had invested their resources wisely in 2012.

“There is evidence that the environmentalists have become a more mature political force,” said Scott H. Segal, who lobbies for utility companies at the firm Bracewell & Giuliani.

“Environmentalist spending was up considerably this cycle, and they seemed to resist the frequent trap of supporting third-party or crank candidates in ways that would have siphoned off votes from mainstream Democrats,” Segal said.

The League of Conservation Voters (LCV) spent more than $14 million this year, more than it had in the past three election cycles combined, and groups including the Sierra Club, National Wildlife Federation Action Fund, Defenders of Wildlife Action Committee, Environment America and Natural Resources Defense Council Action Fund also devoted money and volunteers to key contests.

Margie Alt, executive director of Environment America, said activists decided to focus on several Senate races in order to ensure that House Republicans’ efforts to reverse some of President Obama’s policies curbing air pollution and greenhouse gas emissions linked to climate change would die in the Senate.

“We knew we would have to defend the actions he’s taken this year, and in past years, against rollbacks from coal, from oil and their allies in Congress,” Alt said at a news conference Wednesday.

In a handful of contests, environmentalists’ money, time and targeting played a critical role. Earlier this year, both parties viewed the Senate contest in New Mexico between Rep. Martin Heinrich (D) and former congresswoman Heather Wilson (R) as highly competitive. The U.S. Chamber of Commerce and two conservative super PACs, American Crossroads and Crossroads GPS, spent heavily on television ads attacking Heinrich.

Environmentalists spent nearly $2 million on phone, mail and ads attacking Wilson for her unwillingness to hold oil companies liable for contaminating New Mexico’s water supply with MTBE, a fuel additive. The narrator of one ad rattled off Wilson’s campaign contributions from oil and gas firms before declaring, “It makes you wonder, who’s Heather Wilson with? Not us.”

By the end of the summer, GOP-affiliated groups pulled back from the race after polls showed Heinrich with a significant lead. Heinrich, who came under fire for his support for climate legislation and opposition to the Keystone XL pipeline, said the environmentalists’ ads helped ensure his victory Tuesday.

“They were really strategic and showed a political sophistication that has only emerged in the last few years,” Heinrich said. “They were able to dig down and do some extensive polling to figure out where a candidate’s positions don’t line up with the constituents’ and bring that out.”

Political analyst Stuart Rothenberg, who had rated the New Mexico Senate contest as a tossup/tilt Democrat at the start of the summer, questioned whether environmentalists were decisive, given the state’s Democratic leanings.

“I’m not doubting that they did something,” Rothenberg said of environmentalists. “If they hadn’t done anything, I think Wilson still would have lost.”

Environmentalists did suffer one major loss on the state level: Despite spending more than $10 million to support a constitutional amendment requiring Michigan to source 25 percent of its electricity from renewable energy by 2025, the initiative failed by a wide margin.

Elsewhere in the country, environmentalists made an impact through get-out-the-vote operations. LCV had the largest field operation of any independent group in Montana’s race between Sen. Jon Tester (D) and Rep. Denny Rehberg, (R) spending $1.1 million to register nearly 30,000 Tester supporters to vote by mail.

A Democratic-leaning state environmental group, Montana Hunters and Anglers Leadership Fund, also influenced the race by running last-minute ads urging sportsmen to support Libertarian candidate Dan Cox. Cox received 6.5 percent of the vote Tuesday, at least 2.5 percentage points higher than Libertarians running for either governor or the House. Tester won his race by 3.9 percent.

The group had used money from LCV earlier this year to attack Rehberg. Navin Nayak, LCV’s senior vice president for campaigns, said none of LCV’s money was used to finance the pro-Cox ads. He said LCV Action Fund did rank as the largest fundraiser for Tester, Heinrich and two other Democratic Senate candidates — Timothy M. Kaine (Va.) and Richard Carmona (Ariz.) — through its bundling program. Kaine won, while Carmona lost.

Environmental groups also helped defeat GOP Reps. Francisco R. Canseco (Tex.) and Ann Marie Buerkle (N.Y.), whom they targeted for denying the connection between human activity and climate change.

Some environmentalists say the election provides a mandate for aggressive action on climate change, although oil and gas industry officials warned against over-interpreting the results because the economy ranked as the dominant issue this year.

Environmental Defense Fund President Fred Krupp issued a statement Wednesday saying, “Exit polls confirm that for millions of American voters, Hurricane Sandy and climate change were decisive factors in this election.”

In an interview, Krupp acknowledged that exit polls showed it was Obama’s handling of the storm that swayed voters, adding, “We don’t have empirical evidence” that the link between climate change and extreme weather influenced the election.

“No matter what you think about climate change and clean energy, these were not the drivers of this election,” said Stephen Brown, vice president and counsel for Tesoro Corp., a refiner and marketer of petroleum products. “You can’t claim a mandate from what ended up to be a status quo election.”

Still, there’s no question that the lawmakers headed to Washington next year will recall who helped them get there. Less than three hours after Tester was declared the winner in Montana on Wednesday, LCV President Gene Karpinski received a call from the now two-term senator, thanking him for environmentalists’ support.