(Reuters) - U.S. 9th Circuit Court of Appeals Judge Stephen Reinhardt has died after a 37-year career as a liberal icon on the bench during which he struck down California’s same-sex marriage ban and called President Donald Trump’s immigration policy inhumane.

FILE PHOTO: Judge Stephen R. Reinhardt listens to arguments at the 9th District Court of Appeals in San Francisco December 6, 2010. REUTERS/Eric Risberg/Pool

Reinhardt, 87, died on Thursday of a heart attack while visiting his dermatologist, the United States Ninth Circuit said in a brief statement on its website.

“He was deeply principled, fiercely passionate about the law and fearless in his decisions. He will be remembered as one of the giants of the federal bench. He had a great life that ended much too soon,” said Ninth Circuit Chief Judge Sidney Thomas.

Reinhardt was nominated in 1979 by President Jimmy Carter, a Democrat. Known as the “liberal lion,” Reinhardt recently wrote the opinion striking down California’s same-sex marriage ban and an opinion on Trump’s immigration policy.

President Trump has been critical of the federal appeals court based in San Francisco that has ruled against his policies involving his travel ban and sanctuary cities.

“First the Ninth Circuit rules against the ban & now it hits again on sanctuary cities-both ridiculous rulings. See you in the Supreme Court!,” he tweeted on April 26, 2017.

Reinhardt once voted to declare the “Pledge of Allegiance” unconstitutional, a ruling that was overturned. He also ruled that overcrowding in California’s prisons was unconstitutional.

Many of his rulings favored defendants facing criminal charges, minorities and immigrants and were eventually overturned by the more conservative Supreme Court, the Los Angeles Times reported.

Asked once if he was upset with the Supreme Court, Reinhardt responded “not in the slightest!,” the paper reported. “If they want to take away rights, that’s their privilege. But I’m not going to help them do it,” he said.

Reinhardt was born in 1931 in New York City. He earned a bachelors degree from Pomona College a degree from Yale Law School in 1954. He served in the U.S. Air Force until 1956 and then went into private practice in Los Angeles until 1980.