Firefighters may be able to extinguish the wildfires roaring through California within weeks, but the political effect of the blazes could last at least until the Nov. 6 midterm elections.

With flames forcing tens of thousands of residents to flee their homes and clouds of smoke hovering over large chunks of the state, California Democrats already are using the disaster to flog GOP House members for their environmental votes.

Last week the Democratic group Red to Blue California, which is trying to flip nine Republican-held congressional seats in the state, went on the attack against GOP Rep. Tom McClintock of Elk Grove (Sacramento County). His district stretches from the suburbs of Sacramento south past Yosemite National Park and the Sierra National Forest, where the Ferguson Fire has burned more than 95,000 acres since July 13.

The group put out a mailer and a digital ad that slammed McClintock for his voting record on fire-related issues, saying he had backed cuts to the Forest Service and opposed efforts to increase funding to fight wildfires.

“Career politician Tom McClintock’s position on fire prevention is so bad he might as well be lighting the fires himself,” the group said in its mailer.

McClintock’s backers were quick to respond.

“As the sponsors of these ads know, the bills they referred to were omnibus spending bills in which only a tiny fraction of the funds went to firefighting,” Chris Baker, a campaign spokesman for McClintock, said in a statement. He called the congressman “a leader in the House of efforts to aid forest fire prevention.”

But for Democrats, forcing McClintock to defend himself on an issue like wildfires is already a victory, especially if the message reaches independents and Republicans with an environmental bent.

“We want more (congressional) districts in play and wanted to plant the flag here on McClintock’s turf,” said Andrew Feldman, a spokesman for Red to Blue California. “This shouldn’t be a partisan issue.”

The wildfires “are complete game changers,” said R.L. Miller, the founder of Climate Hawks Vote and one of California’s leading environmentalists. “The path that we’re on (environmentally) right now is frightening to Californians. And if they want to change that path, we have to vote against the people who stand with this administration.”

Miller hopes to appeal to younger Republicans, who hold much different views than older Republicans on the environment.

A May survey by the nonpartisan Pew Research organization, for example, found that 44 percent of Millennial Republicans supported more offshore drilling, compared with 75 percent of Baby Boomer and older Republicans.

Last week, the Sierra Club released digital ads against Republican Reps. Jeff Denham of Turlock (Stanislaus County) and Steve Knight of Lancaster (Los Angeles County) that turn up the heat on their environmental voting records. Each ad says the targeted GOP congressman likes “carbon, methane and air pollution more than he likes our kids.”

Many environmental issues cut across party lines in California, delivering allies to Democratic candidates they wouldn’t have on issues with a more partisan split such as immigration, government spending and single-payer health care.

Across the state, the environment “is not so much a partisan issue as a California issue,” said Mark Baldassare, president and CEO of the Public Policy Institute of California, which polls regularly on state candidates and issues. “A large number of Republicans and independents join Democrats in support of issues that involve the environment.”

A poll released last month by the institute highlighted a surprising nonpartisan tilt on many green issues.

Nearly 3 in 4 Californians, including 71 percent of Republicans, see ocean and beach conditions as very important to the state’s future economy and quality of life, the poll said. Fewer than half of California Republicans surveyed said the overall quality of the ocean is at least good, and two-thirds of respondents, including 40 percent of Republicans, opposed drilling off the state’s coast.

Polling done in April for the anti-offshore drilling group Protect the Pacific in three GOP-held congressional districts in Southern California shows just how important environmental issues can be for Democrats.

In all three, a strong majority of respondents opposed drilling off the coast, with more than 79 percent saying ocean and beach conditions are important to them personally.

When 58 percent of those polled in Orange County’s 45th Congressional District say GOP Rep. Mimi Walters of Irvine should vote to oppose offshore drilling, that’s awful news for Walters, who has called in the past for more oil platforms off the coast.

“There’s an expectation that the coast is incredibly important to the local economy and the quality of life,” said Adam Probolsky, who conducted the poll. “It’s not about political philosophy.”

Those economic concerns also can play a very different role than they have in the past.

In previous years, some Democrats running in conservative districts wouldn’t talk as much about the environment if their Republican opponent said tighter regulations could choke off job growth.

“But now they can say, ‘Look at California: We have a great environmental record in the country and our economy is adding a lot of jobs,’” said Mike Young, associate director of campaigns and organizing for the California League of Conservation Voters.

The Democrats’ environmental message got an unexpected — and unintended — boost from President Trump, who tweeted last week that “California’s wildfires are being magnified & made so much worse by the bad environmental laws which aren’t allowing massive amounts of readily available water to be properly utilized. It is being diverted into the Pacific Ocean.”

For Democrats, tweets like that, along with Trump’s calls for such things as easing auto emission rules, pushing for more coal mining, rewriting the Endangered Species Act and cutting the size of some national monuments, can help make the president part of the California House contests.

They’d love that because Trump’s popularity in the state started low and has stayed there. Just 31 percent of respondents to a Public Policy Institute of California poll this month in competitive House districts thought he was doing a good job on environmental issues.

“California Democrats should be salivating at an opportunity to nationalize the congressional races” by forcing GOP incumbents to say whether they stand with the president’s environmental policies, said David McCuan, a political science professor at Sonoma State University. “They can use the environment in California because so many voters react so strongly.”

One of the reasons is that there are plenty of voters who still remember the huge Santa Barbara oil spill in 1969 and the choking smog that for decades was a regular part of life in Southern California.

Those voters “don’t want to go back to when they couldn’t go outside because they couldn’t breathe the air,” Baldassare said.

John Wildermuth and Joe Garofoli are San Francisco Chronicle staff writers. Email: jwildermuth@sfchronicle.com, jgarofoli@sfchronicle.com Twitter: @jfwildermuth, @joegarofoli