Former President Barack Obama has praised retired Supreme Court Justice John Paul Stevens, who died Tuesday, saying that the late jurist “heard cases with a level of grace, humility and fidelity to our highest ideals that we should hope all our public servants strive for.”

Stevens was the third-longest serving justice in history. He died after suffering a stroke at the age of 99, passed away peacefully with his daughters by this side, the Supreme Court said in a statement.

“His balancing of legal precedent with the Constitution’s call for equal justice and an understanding of Americans’ daily lives helped the court—and the country—navigate controversial and defining questions of who we are and who we can be,” Obama said in a statement Wednesday. “And in doing so with his signature pragmatism and modesty, he played a pivotal role in carrying forward our founding promise into today.”

Stevens retired in 2010, leading the way for Obama, a Democrat, to nominate Elena Kagan to replace him.

“He was a good man, a decent man. And our country is better because of his leadership and his example,” Obama said. “Michelle and I send our warmest condolences to his family and friends, all those who worked with him, and all those whose lives are better because of his legacy.”

Republican President Gerald Ford had nominated Stevens to the Supreme Court in 1975 in the wake of the Watergate scandal. During his time on the bench, Stevens’ opinions evolved and generally moved farther to the left.

Stevens was known for being a liberal and a pragmatist voice on the Supreme Court, even as the court became more conservative.

In the more than three decades that he served as a judge, Stevens became more supportive of affirmative action and more opposed to the death penalty. In one key opinion, he held that any fact that could increase a defendant’s criminal sentence needed to be found by a jury beyond a reasonable doubt.

Stevens remained vocal even after his retirement from the Supreme Court.

In recent years, the retired judge urged the US to legalize marijuana and repeal the Second Amendment. Stevens also weighed in on the controversial confirmation hearings of Supreme Court Justice Brett Kavanaugh, saying that he no longer believed Kavanaugh was qualified for a seat on the bench. In 2017, he criticized Trump’s remarks against courts pushing back against a proposed travel ban involving several Muslim-majority countries.

Write to Sanya Mansoor at sanya.mansoor@time.com.