Ellen DeGeneres said she hoped she had inspired people to be “your true authentic self” as she concluded the final episode of her US talk show.
The comedian and actress, 64, noted that when she first started the long-running show she was not allowed to say the word “gay”.
She was also not allowed to use the word “we” implying that she and her partner Portia de Rossi were together.
DeGeneres received a lengthy standing ovation from the audience as she walked out for the final episode, which included guest appearances from Jennifer Aniston, Billie Eilish and Pink.
Speaking about the show, which first premiered in 2003, she said: “Twenty years ago, when we were trying to sell the show, no one thought that this would work.
“Not because it was a different kind of show but because I was different.
“Sure couldn’t say wife, and that’s because it wasn’t legal for gay people to get married, and now I say wife all the time.”
Concluding the show, she added: “I hope I’ve inspired you to be yourself, your true authentic self.
“And if someone is brave enough to tell you who they are, be brave enough to support them, even if you don’t understand.”
The show has won multiple Emmy awards during a run that has seen more than 3,000 episodes recorded.
The final episode kicked off with a clip showing the premieres of her previous 18 series before cutting to the final episode.
Ms de Rossi and Ellen’s brother Vance DeGeneres were seen clapping from the front row as the camera panned around the cheering crowd.
Wearing a buttoned up white shirt and black blazer, DeGeneres applauded her audience back and took several deep breaths before her opening monologue.
Aniston was the first guest on the first episode of the show and has been on the programme 20 times since.
The two reminisced about their first chat about toilet paper as well as the ending of hit US sitcom Friends, before Aniston presented DeGeneres with a door mat, reading “Thank you for the memories.”
“I love you, and I so appreciate you and what you have given to the world over the last 19 years. The contribution is endless,” Aniston told DeGeneres.
The actress then introduced a video showing a compilation of DeGeneres’s charity work and role in pushing equality for the LGBT community.
Oscar-winning singer Billie Eilish also expressed her love for the chat show host, as did the So What singer Pink.
“I love you so much it’s dumb,” Pink told DeGeneres.
“I wanted to grow up and be a singer and change the world and you’ve done that in so many ways.
“You have made an indelible mark on this world and reminded them that joy is always a choice.”
The singer then gave a performance of What About Us.
DeGeneres announced last year that she was stepping down from her TV show after controversy over an alleged toxic workplace environment.
In 2020, she apologised to staff after an internal review by Warner Bros found “deficiencies related to the show’s day-to-day management”.
The review was launched after reports of a toxic environment on the programme but DeGeneres has denied that is the reason she is ending the show.
Asked whether she had any regrets about not ending the show sooner, she said: “I have to just trust that whatever happened during that time, which was obviously very, very difficult, happened for a reason.
“I think that I learned a lot, and there were some things that came up that I was shocked and surprised by. It was eye-opening but I just trust that that had to happen.”