Beloved EastEnders' character Peggy Mitchell said goodbye to Albert Square for the final time as she took her own life in a heartbreaking scene.

The former Queen Vic landlady, played by Dame Barbara Windsor, took an overdose after breaking the news to son Grant (Ross Kemp) that her cancer had returned and taken a "proper grip" on her.

In a poignant final scene, after smelling cigarette smoke throughout the episode, Peggy hallucinated the return of her former love rival-turned-friend Pat Butcher (Pam St Clement), puffing away in thick pink lipstick and with "earrings rattling like Marley's bleeding chains".

Speaking to her friend, who passed away in the soap from cancer in 2012, Peggy said: "I'm being eaten alive and it hurts and I can't wait.

"I don't want that to be me, I don't want to be that little old lady in the bed, with people saying, 'Remember her? Peggy Mitchell? She's all skin and bones'."

She continued: "I will go as I have lived: straight back, head high, like a queen."

The ghost Pat remained with Peggy as she took a handful of pills alone, with the camera panning over letters left to her children before a clock stopped to indicate the end of the Square's most vivacious, loved and enduring residents.

Earlier in the episode, viewers had watched Peggy take one final trip to her former pub where sons Grant and Phil (Steve McFadden) tried to convince her to not go through with her suicide.

Peggy reasoned with them, saying: "It's in my bones and it's in my brain and I'm not going to get any better. I hurt. I'm not able to hold onto myself. I'm losing myself. All my thoughts, they slip through my brain like water."

Phil replied: "You making out it's romantic and easy and simple. It's not just slipping off to sleep. It's horrible. it's terrible and it's cruel.

"It's our turn to look after you."

Grant was seen leaving the Square to return to Portugal after a heart-to-heart with Phil about his liver cirrhosis, both sons wrongly convinced they had stopped their mother in time.

Dame Barbara, 78, made her debut in the soap in 1994 and it became the defining role of her career.

She played Peggy full-time until 2010, and subsequently revived the Walford stalwart for occasional appearances.

As the landlady of the Queen Vic, Peggy was much loved for her feisty temperament and her "Get outta mah pub!" catchphrase, although she happily handed over the pub's reins to Linda Carter (Kellie Bright) in her final episode.

Peggy's funeral will see another EastEnders favourite return in the form of Danniella Westbrook, who played her daughter Sam Mitchell, as the family gather along with the soap's fans for a final farewell.