As Sen. Bernie Sanders (I-Vt.) stays in the race for the Democratic nomination, he’s identified climate change as a top issue for young voters and argued that his rival, former vice president Joe Biden, is not willing to take the dramatic steps needed to save the planet.

But in his nearly three decades in elected office, Sanders’s all-or-nothing approach means he has sometimes forgone legislative efforts to make near-term progress on climate.

Sanders has viewed global warming as a top priority for years, pressing for major cuts in the nation’s emissions of greenhouse gases and a switch from fossil fuels to wind, solar and other renewables.

More than almost any other issue, Sanders’s approach to climate change suggests how he would govern as president. While he’s occasionally found common ground with like-minded Democrats, he has often rejected incremental steps toward potentially durable, bipartisan compromise.

And when bipartisan talks cratered a decade ago, Sanders concluded that the only option was to mobilize a grass-roots movement to demand a sweeping shift in how the United States produces and consumes energy.

The collapse of legislation in 2010 passed by the House that would have imposed a national cap on greenhouse gas emissions “even after significant compromises had been accommodated, only underscored for the senator the limits of politics as usual,” Sanders spokesman Keane Bhatt wrote in an email.

“The failure of that process — of negotiating tepid reforms, engaging in political horse-trading, allowing key provisions to be watered down by political and industry insiders — all pointed to the urgency of building a powerful, popular, grass roots movement to hold Washington accountable,” Bhatt added.

In doing so, Sanders has effectively moved the Democratic Party to the left on climate change. Nearly every major 2020 candidate — including Biden — has called for steeper carbon cuts than President Barack Obama endorsed and has backed the idea of banning all new oil and gas drilling on public lands and offshore. But it also raises questions on how he would enact sweeping policies to curb carbon emissions if he occupied the Oval Office.

Bipartisan Policy Center President Jason Grumet, who has worked on energy and climate policy for three decades, said Sanders considers himself a “big idea progressive” but he’s not been focused on achievable, short-term goals.

The closest Congress came to passing major climate legislation came in the late 2000s, when several Senate Republicans were working with their Democratic counterparts. One of the most promising measures was a bill, co-sponsored by Sens. Joseph I. Lieberman (I-Conn.) and John W. Warner (R-Va.), which by mid-century would have cut the United States’ carbon output 63 percent compared with 2005.

Sanders preferred legislation he co-sponsored with Sen. Barbara Boxer (D-Calif.) that would have reduced U.S. greenhouse gas emissions 80 percent by 2050. That bill was unlikely to become law but reflected current science and was “designed to give a nudge to the next administration,” said Erich Pica, president of Friends of the Earth.

Still, some centrists wanted to forge a bipartisan deal more quickly and they lined up behind the Lieberman-Warner bill. Sanders opposed it during a key subcommittee vote, arguing it was not stringent enough, though later backed it during a full committee vote.

Chelsea Henderson, who served as Warner’s senior policy adviser for climate change, said that Sanders complicated negotiators’ task in forging a compromise. While the bill made it to the Senate floor, it failed to overcome a Republican filibuster.

“We had anywhere between 10 and 15 Republicans willing to do something on climate change, and the something wasn’t enough,” said Henderson, who now serves as a consultant to Republicans seeking to address climate change. “I understand wanting to advance the most intense bill, but I never really felt like he was willing to broker a deal.”

Sanders’s aides noted that he offered four amendments to the ill-fated bill that were adopted, including one to support domestic manufacturing of renewable energy equipment and technology.

Sanders did score his biggest climate victory in 2007, working with other Democrats to help make buildings and transportation systems on the state and local level more energy efficient. The program received $3.2 billion during the Obama administration as part of the American Recovery and Reinvestment Act, though it has not gotten additional funding since.

Bill McKibben, a climate activist and a fellow Vermonter, said in an interview that Sanders consistently challenged the idea that the United States could not wean itself off fossil fuels. Touting the idea of “10 million solar roofs,” Sanders helped launch a federally funded program in Vermont aimed at improving solar panel efficiency in cold-weather climates.

“He would have town halls with a couple of thousand Vermonters in a high school gym on a Sunday morning and talk about climate change, or have me talk about climate change, and have an energy fair. So he’s always been really interested in it, and willing to be outspoken,” McKibben said.

But by the time Obama took office in 2009, Sanders had fully distanced himself from bipartisan efforts to address climate change. In June that year, the House narrowly passed the American Clean Energy and Security Act, which would have created a cap and trade system to reduce emissions.

Joseph Aldy, who served as special assistant to the president for energy and environment between 2009 and 2010, said the White House and its Senate allies were focused on getting Midwestern Democrats and centrist Republicans to produce a measure that could be reconciled with the House bill.

“I remember meeting with staff from a lot of different offices,” Aldy said. “I don’t remember Sanders’s staff being that engaged.”

Sanders was focused at the time on passing the Affordable Care Act, according to current and former Hill staffers.

The legislation never came to the Senate floor for a vote.

The Senate abandoned its effort to pass a climate bill in mid-2010, and Sanders joined McKibben and others in fighting a federal permit for the Keystone XL pipeline, slated to transport tar sands oil from Canada to the U.S. Gulf Coast.

Under pressure from Democratic activists, Obama denied the permit in 2015, citing concerns over its impact on climate change. But President Trump gave the project a greenlight in 2017.

Sanders co-authored the first “keep it in the ground” bill in 2015 aimed at blocking any new fossil fuel extraction from federal lands or waters. He helped craft the Green New Deal resolution, which would spend trillions of dollars in an effort to bring the nation’s net greenhouse gas emissions to zero within a decade, and proposed eliminating the fracking of oil and gas nationwide.

None of those efforts have gained traction among Republicans needed for passage.

Since Trump took office, Sanders has routinely skipped hearings of the Environment and Public Works Committee, on which he serves. Of 82 hearings in the past three years he has attended two, according to committee records. He was the only minority member of the panel not to speak in an all-night speech-a-thon opposing Scott Pruitt, former administrator of the Environmental Protection Agency.

Sanders’s aides said he has focused on mobilizing grass-roots opposition to Trump in recent years, even when that’s meant missing hearings or votes.

Left-leaning climate groups such as the Sunrise Movement and Extinction Rebellion have endorsed Sanders, saying that he is more committed to their cause than Biden.

While Biden has endorsed “keep it in the ground” and the idea of rejoining a global climate agreement aimed at cutting the world’s carbon output, his climate plan costs a fraction of Sanders’s and imposes fewer restrictions on natural gas production.

“Leading with half-baked solutions that don’t energize the base, and might fully rely on market mechanisms that do not solve the crisis, can actually further alienate the people we need to win transformative economic climate policy,” said Lauren Maunus, legislative manager for the Sunrise Movement.

Jose A. Del Real contributed to this report.