Sampras, the top seed, rode his big serve to a 6-1, 6-7 (5-7), 6-1, 6-4 victory to advance to the semifinals.
After Becker sailed a backhand long to close out the match, the two players greeted each other warmly at the net and the German whispered to Sampras that this was the end of his Wimbledon career.
As he left Center Court, Becker twice bowed deeply to the crowd with arms outstretched.
"That was it for me," the 29-year-old Becker said later. "This was my last time at Wimbledon. I think it's a very good moment right now. I just don't feel I have it any more what it takes to win a Grand Slam. I don't have what it takes to go all the way."
Becker said he may still play the U.S. Open and would continue in tour events, but would not enter any Grand Slam tournaments next year.
Becker won Wimbledon in 1985, 1986 and 1989 and this was his last legitimate chance at another crown.
"I feel very relieved," he said. "I feel I've come to the end of the road with my head up high."
Sampras said he was taken aback by the retirement. "I walked off the court and felt a little bit strange," he said. "Wimbledon and Boris went together. This is where he made his mark as a 17 year old. It was like his living room out there. It's a bit of a somber feeling. I felt honored in a way that I was his last match."
Sampras never lost his serve during the match, saving the only three break points against him.
In the semifinals, Sampras will face unseeded Todd Woodbridge of Australia, who beat 19-year-old German Nicolas Kiefer 7-6 (9-7), 2-6, 6-0, 6-4.
The other semifinal will pit 1991 champion Michael Stich against Cedric Pioline, both unseeded, who dented British hopes by ousting Tim Henman and Greg Rusedski.
Stich, playing in his last Wimbledon before retirement, overwhelmed Henman 6-3, 6-2, 6-4. Pioline outplayed Rusedski 6-4, 4-6, 6-4, 6-3.
In women's play, Martina Hingis maintained her perfect record against Anna Kournikova, becoming the youngest Wimbledon women's finalist in 110 years. In an error-filled match, Kournikova held serve only once and Hingis labored to a 6-3, 6-2 victory in 62 minutes before a muted Center Court crowd.
The top-seeded Hingis will face the winner of the semifinal between Jana Novotna and Arantxa Sanchez Vicario.
A Message from The Moscow Times:
Dear readers,
We are facing unprecedented challenges. Russia's Prosecutor General's Office has designated The Moscow Times as an "undesirable" organization, criminalizing our work and putting our staff at risk of prosecution. This follows our earlier unjust labeling as a "foreign agent."
These actions are direct attempts to silence independent journalism in Russia. The authorities claim our work "discredits the decisions of the Russian leadership." We see things differently: we strive to provide accurate, unbiased reporting on Russia.
We, the journalists of The Moscow Times, refuse to be silenced. But to continue our work, we need your help.
Your support, no matter how small, makes a world of difference. If you can, please support us monthly starting from just $2. It's quick to set up, and every contribution makes a significant impact.
By supporting The Moscow Times, you're defending open, independent journalism in the face of repression. Thank you for standing with us.

Remind me later.