Jennifer Aniston was almost replaced in 'Friends'.

Jennifer Aniston

Jennifer Aniston

The 'Cake' actress - who is engaged to Justin Theroux - played Rachel Green in the much-loved comedy sitcom between 1994 and 2004, but was almost fired before it aired due to filming commitments with the short-lived series, 'Muddling Through'.

She revealed: "Friends came when I was off doing Muddling Through.

"So there was a period where I had to stand out of the photographs for the group shots, and I had phone calls from girlfriends saying, 'I'm auditioning for your part in Friends.'"

However, she felt thankful when the CBS sitcom flopped as it meant she was able to keep her part in the series, in which she starred along with Lisa Kudrow, Courteney Cox, David Schwimmer and Matt LeBlanc.

She continued: "They just took the chance that Muddling Through would fail after the two episodes they picked it up for.

"So I just started doing this back-and-forth from Sony to Warner Bros. for two weeks."

Luckily for the 45-year-old actress, 'Muddling Through' only lasted three months so she was able to keep the role of Rachel, but confessed producers almost made her play Courteney's character, Monica.

Speaking at the Santa Barbara International Film Festival, she added: "They wanted Courteney to play Rachel.

"And unbeknownst to each other, I wanted to play Rachel and she wanted to play Monica. It worked out perfectly."