Stevens, 90, spent 35 years on the nation's highest court, which closed out its term for the summer.
"It has been an honor and a privilege to share custodial responsibility for a great institution with the eight of you and with 10 of your predecessors," Stevens told the other justices in an emotional farewell that he finished with a smile.
Chief Justice John Roberts led the justices in thanking Stevens for his service.
"Your decision to retire saddens each of us in distinct ways," Roberts said before gaveling the session to a close. "You have enriched us through your inspiring example of public service. The bonds of friendship that we have forged extend beyond our common endeavor."
Stevens' fellow justices, along with retired justices David Souter and Sandra Day O'Connor, signed a letter of gratitude to him.
The justices also paid tribute to the late husband of Justice Ruth Bader Ginsburg, Martin, who died Sunday of cancer, just days after they celebrated their 56th wedding anniversary.
Exploding whale video goes viral on Internet
Britney Spears on kissing Ryan Gosling, Justin Timberlake in the Mickey Mouse Club