Image copyright Reuters Image caption He led the court's liberal wing and was an outspoken critic of the court after he retired

Former US Supreme Court Justice John Paul Stevens has died at the age of 99, after suffering a stroke.

In a statement, the court said Mr Stevens "passed away peacefully" at a Florida hospital on Tuesday.

One of the longest-serving US justices, he was on the liberal side of the court despite being appointed by Republican President Gerald Ford.

He wrote more dissenting opinions than any other Supreme Court Justice in US history, and retired in 2010.

"He brought to our bench an inimitable blend of kindness, humility, wisdom, and independence. His unrelenting commitment to justice has left us a better nation," Chief Justice John Roberts said in the statement.

Born in Chicago in 1920, Mr Stevens served as a military codebreaker during World War Two, before studying law and becoming a judge after the war.

He was appointed to the court in 1975. Once at its ideological centre, Mr Stevens became leader of the liberal faction as the court moved to the right from the early 1990s.

His views evolved over time, including on the death penalty, which he initially supported.

Mr Stevens also embraced liberal positions on issues including abortion, gay rights, gun control and the separation of church and state.

Image copyright Reuters Image caption Mr Stevens was awarded the Presidential Medal of Freedom in 2012 by President Obama

He was known for his dissenting opinions, notably in 2000 after the court voted to halt ballot recounts in Florida during that year's presidential race. The decision effectively handed the presidency to George W Bush.

"Although we may never know with complete certainty the identity of the winner of this year's presidential election, the identity of the loser is perfectly clear," Mr Stevens wrote at the time. "It is the nation's confidence in the judge as the impartial guardian of the rule of law."

He continued to capture headlines after his retirement at age 90.

Last October, he intervened in the confirmation battle over President Donald Trump's second Supreme Court nominee, Brett Kavanaugh. He argued that Mr Kavanaugh should be barred from the role because of partisan comments made during his confirmation hearing.

In one of his last interviews, he told the Wall Street Journal that President Trump was "exercising power that do not really belong to him".