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.