Dame Barbara Windsor's Peggy Mitchell bows out of EastEnders
Dame Barbara Windsor has said her final farewell to EastEnders with her character Peggy Mitchell seen apparently taking an overdose of pills.
Viewing figures peaked at eight million during the show's final minutes.
Peggy, who had cancer, was seen talking to the ghost of her friend, Pat Butcher, before talking some unidentified pills.
"I will go as I have lived," she said to Pat. "Straight back, head high, like a queen."
Dame Barbara, 78, recently returned for the former landlady's final episodes.
EastEnders is watched by an average of 7.2 million viewers, including the number of people watching it on catch-up services. The average live viewing figure for Tuesday's show was 6.9 million, but it will be a week before the number of catch-up viewers will be known.
In a poignant final scene, Peggy hallucinated the return of her former love rival-turned-friend Pat, played by Pam St Clement, who died from cancer in the soap in 2012.
After the credits rolled, the camera returned to the room, showing an empty glass of water, empty bottle of pills, an envelope addressed to her son, Phil, and a clock.
But the charity Care Not Killing, which is opposed to euthanasia, said the storyline was "disappointing", adding: "Yet again the BBC is acting as the cheer leader for assisted suicide and suicide, by killing off one of the best known and well-loved characters on British TV."
It said terminal illness and suicide "warrant measured and informed debate" but the show had "ignored" the alternatives of palliative, hospice and home care.
"It is depressing that yet again the BBC has missed an opportunity to share with the nation the work of the army of volunteers, doctors and other health care professionals who support the overwhelming majority of the half a million people who die every year in this country," the charity said.
However it welcomed the programme makers seeking advice from the Samaritans.
The Samaritans' Lorna Fraser wrote in a blog on the BBC's EastEnders website they were "really pleased" to be asked to work with EastEnders on Peggy's storyline to help them.
She added covering the topic of suicide "in the media does also carry risk", citing studies in the UK and abroad which "show links between inappropriate coverage of suicide in media, with increases in suicidal behaviour among vulnerable people, making careful handling of this crucial".
"We urge other TV dramas and news organisations to do this, together we can ensure that the topic of suicide is covered in a way that is safe and helpful."
The BBC said EastEnders has "a rich history of tackling difficult social issues and Peggy's story is one of these".
It stressed it had "worked closely" with leading medical experts and various charities to "ensure that this storyline is portrayed as sensitively and responsibly as possible".
"At no point do we glamorise or romanticise the issue of suicide, in fact we have taken great care to show the audience not only Peggy's perspective but the many different views of those around her."
Anna Karen, who plays Peggy's sister Aunt Sal in the soap, told BBC Radio 4's Today programme the storyline was "a very moving and a lovely tribute to Barbara".
Viewers also voiced their sadness at Peggy's demise, as well as their delight at Pat's brief return, with Johnny B tweeting: "Wow what an amazing episode... Pat and Peggy back together forever. So emosh."
Chris Burrow tweeted the storyline was "brilliantly played by the cast involved; very moving episode".
Dame Barbara joined the BBC One soap in 1994 and has been one of the show's best-loved matriarchs.
BBC One's The One Show was live in Albert Square to mark her exit and a feature, Peggy Mitchell: Last Orders, debuted on the BBC iPlayer.
When her final departure was announced in January, Dame Barbara said Peggy was "a character close to my heart but I made the decision a while ago that I need to say goodbye to her once and for all".
"Otherwise, she will always be there, urging me to go back, and that is something I need to shut the door on."
Her final scenes have also seen Ross Kemp, who plays her son Grant Mitchell, return to the soap after a 10-year absence, to join his on-screen brother Phil, played by Steve McFadden.