President Biden told the American public in an Oval Office address on Wednesday that he had abandoned his re-election campaign because there is “a time and a place for new voices, fresh voices — yes, younger voices.”

His words, lasting 11 minutes in all, were the first extensive ones from Mr. Biden since his decision to step aside, and expanded on his initial announcement, delivered in a post on social media on Sunday, that he was dropping out of the race. His tone was wistful and his speech was an early farewell.

“It’s been the privilege of my life to serve this nation for over 50 years,” he said.

Sitting behind the Resolute Desk and surrounded by photos of his family, Mr. Biden ticked through the accomplishments of his term, ranging from the choice of the first Black woman to be a Supreme Court justice to pulling the country out of a paralyzing pandemic. He expressed gratitude to the American people for allowing a “kid with a stutter” from modest beginnings in Scranton, Pa., to reach the pinnacle of American politics.

Just beyond the camera, dozens of aides and several members of his family, including Jill Biden, the first lady, watched as Mr. Biden said he would walk away from the office they had worked to help him reach for decades.

“I revere this office,” he said, “but I love my country more.”

Ultimately, Mr. Biden said, he concluded that “the best way forward is to pass the torch to a new generation.” The president praised Vice President Kamala Harris — “she’s experienced, she’s tough, she’s capable” — but warned, as he has for years, that Americans faced a choice between preserving democracy and allowing it to backslide.

“History is in your hands,” Mr. Biden said. “The power is in your hands. The idea of America lies in your hands. We just have to keep faith, keep the faith, and remember who we are.”