WASHINGTON (Reuters) - President Donald Trump, members of the U.S. Supreme Court and others paid their respects on Monday to liberal Justice John Paul Stevens, who died last week, as his body lay in repose in the courthouse’s stately great hall.

Stevens, who was appointed by President Gerald Ford in 1975 and retired from top U.S. judicial body in 2010, died on July 16 at age 99 of complications from a stroke in Fort Lauderdale, Florida. He was one of the longest-serving justices in U.S. history.

Five of the nine current justices, including Chief Justice John Roberts, attended a brief ceremony. They stood somberly with heads bowed in front of the black casket, which was draped with a U.S. flag.

Trump, accompanied by first lady Melania Trump, visited after the ceremony, pausing silently in front of the casket for a few moments.

Before walking to the casket, Trump shook hands with Roberts, who the Republican president has criticized in the past. Roberts last year issued an unusual statement rebuking Trump for his criticisms of judges who have ruled against him, and in June was the author of a ruling that blocked the Trump administration from including a contentious citizenship question in the 2020 national census.

During the ceremony, liberal Justice Elena Kagan, who replaced Stevens on the court, delivered brief remarks.

“He was a brilliant man with extraordinary legal gifts and talents, which he combined with a deep devotion to the rule of law and a deep commitment to equal justice,” Kagan said of Stevens.

Slideshow ( 16 images )

Stevens’ family members and dozens of his former law clerks also attended. Stevens’ male relatives wore bow ties, echoing the late justice’s signature sartorial preference.

The four absent justices had previously scheduled commitments, a court spokeswoman said.

Stevens was scheduled to be buried on Tuesday in Arlington National Ceremony in Virginia.

Stevens was a Republican appointee who became a key liberal vote on the court. As it moved to the right in the early 1990s under Chief Justice William Rehnquist, Stevens became the leader of the court’s liberal faction. That continued when Roberts replaced Rehnquist in 2005, with the justices often sharply divided on social issues such as abortion.

He retired in 2010, allowing Democratic President Barack Obama to pick Kagan to replace him. Stevens became more outspoken in his views after he retired and was openly critical of the increasingly conservative court he left behind.