Anthony Kennedy is retiring, and progressives around the country are trying not to freak out. The 81-year-old justice, who has served on the Supreme Court since 1988, has been a crucial swing vote on many issues from abortion to gay marriage to campaign finance. And — for better or worse — he has also been the deciding vote on environmental issues for the past three decades.

As a moderate on an increasingly divided court, Kennedy has been in the majority in an outstanding number of environmental cases. As Lewis and Clark environmental law professor Michael Blumm writes, “Advocates in environmental cases must tailor their arguments to win his vote or risk losing their appeals.”

Over his 30-year tenure, Kennedy — who was once called by the New York Times an “equal opportunity disappointer” — has been a mixed bag for environmentalists.

In Massachusetts v. EPA, the most consequential ruling on climate change in the past two decades, Kennedy was the swing vote. The state of Massachusetts had challenged the EPA’s refusal to regulate greenhouse gases, despite profound and convincing evidence that they are harmful to human health and well-being.

Grist thanks its sponsors. Become one.

Kennedy joined the four liberal justices, arguing that the EPA would have to treat CO2 like any other pollutant, unless the Bush-era agency provided “scientific basis” for its reasoning. Although he didn’t write the majority opinion, without him — or with a more staunchly conservative justice in his place — we might still be fighting to have CO2 recognized as a pollutant at all.

On the other side of spectrum, Kennedy, again as the swing vote, tempered his support for the EPA by aligning with conservatives in the 2014 decision on Utility Air Regulatory Group v. EPA, joining the late Antonin Scalia’s majority opinion. The majority argued that while the EPA could continue to place limits on CO2 emissions from large stationary pollution sources like power plants, the administration could not regulate smaller sources like schools, apartment buildings, or businesses.

Grist thanks its sponsors. Become one.

In 2006, a Michigan property owner, John Rapanos, faced criminal charges from the EPA for draining and filling in potentially protected wetlands with earth. Conservative justices wanted to dramatically restrict the definition for wetlands — which would have decimated protected areas across the country.

Kennedy’s decisive opinion in the case, Rapanos v. United States, established a new standard which protected all wetlands that are part of a “significant nexus” of navigable waters. It was a win for environmentalists — but one that still significantly restricted wetland protection under the Clean Water Act.

Despite his mixed record, any replacement for Kennedy will likely have a much, much worse record on environmental issues. Neil Gorsuch, Trump’s first Supreme Court appointment — and the son of a former EPA administrator to whom current chief Scott Pruitt has garnered frequent comparisons —  has been an opponent of many Clean Water Act and Clean Air Act protections throughout his career. Some of the other members on Trump’s initial shortlist carried even more alarming disregard both for issues of civil liberties and for the environment. And Kennedy has, at times, provided the much-needed fifth vote to reject restrictions on abortion rights, with significant impacts for both women’s health and our environmental future.

It remains to be seen exactly what the new justice will think of the EPA, clean air protections, and climate change, but the conservative-liberal split on the court will significantly change for the first time in decades. Environmentalists may have gotten lucky with Kennedy’s moderate support of CO2 regulation and protecting wetlands — and chances are their luck has run out.

“I’m fearful,” Blumm, the law professor, told Grist. “And I think all people who watch the court and care about the environment should be fearful.”