Jennifer Aniston joked about her divorce from Brad Pitt during the final episode of "The Ellen DeGeneres Show."

The "Friends" star, who was Ellen DeGeneres' first guest when her program premiered in September 2003 and appeared on the show 20 times, joined the host as the popular talk show aired its final episode on May 26 after 19 seasons.

At one point during the episode, she and the host reminisced about the show's almost two-decade run and talked about dealing with program finales.

"Oh, where does 19 years go?" Aniston said as a video screen showed images from her appearances on the talk show. "I don't understand."

DeGeneres then asked her how she felt when "Friends" aired its final episode in May 2004. Despite the sentimental nature of their conversation, Aniston managed to interject some humor by making a joke about her widely talked about divorce from her ex-husband Pitt, which was finalized in October 2005, just more than a year after the iconic sitcom officially ended its run.

"Well, I got a divorce and went into therapy," she told DeGeneres. "Oh! And then I did a movie called 'The Break-Up.' I just kinda leaned into the end. I just was like, 'You know what, guys? Let's make this a completely new chapter. Let's just end everything and start new.' It worked great!"

She quipped, however, that DeGeneres, who is married to Portia de Rossi, should not follow her lead. "Now you and Portia, no, no," she said.

Aniston and Pitt announced their split in January 2005 after being married for nearly five years. Both of them eventually remarried, with Pitt tying the knot with Angelina Jolie in August 2014 and Aniston marrying Justin Theroux in August 2015. Unfortunately, their second marriages also came to an end. Despite their history, Aniston and Pitt are good friends and have been supportive of each other throughout the years.

Meanwhile, Aniston asked DeGeneres what her next chapter might include, and the host answered she had no idea. "I know that I want to just lay low for a little while. I want to rest," DeGeneres explained. "And then I'll do something again but I don't know what it is."

Brad Pitt and Jennifer Aniston
3. Brad Pitt and Jennifer Aniston - These two were the “it” couple in the late 90’s -- Brad Pitt was one of the biggest Hollywood stars at the time, while Jennifer Aniston was labeled as America’s sweetheart. Hence, the media couldn’t get enough of how good-looking the couple was. They went public with their relationship at the 1999 Emmy Awards red carpet. After a year of dating, they had a Malibu-beach wedding. Both have been quite open about professing their love for each other in front of the media. However, after seven years of being together, Aniston filed for divorce in 2005 due to “irreconcilable differences.” It became a crazy breakup after Pitt went public with his then relationship with Angelina Jolie shortly after. The two stars met on the set of 2005's "Mr. & Mrs. Smith," a movie they filmed while Pitt was still with Aniston. Pitt and Jolie have also decided to divorce in 2016. Kevin Winter/ Getty Images