The bikini worn by Dame Barbara Windsor in the 1969 film Carry On Camping has sold at auction for £9,500.
The late actress wore the swimwear in a famous scene where her bikini top flew off in the middle of an exercise class.
The proceeds from sale of the item, which had been rescued from a bin decades ago, will be donated by the vendor to the Alzheimer's Society.
The actress, who also starred in EastEnders, died in December from Alzheimer's at the age of 83.
An image from the scene in Carry On Camping was included in the order of service for her funeral, accompanied by her quote: "That picture will follow me to the end."
The scene had to be shot three times, with the garment being removed by the deft use of a fishing rod in the hands of an off-screen assistant.
Remnants of the fishing line could still be seen stitched to the front of the top, the auction house said.
The item was sold to an American buyer after a bidding war between telephone and online buyers.
Dame Barbara's husband Scott Mitchell said: "It's a touching tribute to Barbara to think any item associated with that famous scene will raise money to help people living with Alzheimer's.
"I'd say it was fitting - but it flew off.... so it wasn't!"
Auctioneer Kerry Taylor said: "We have had so much interest in this bikini, from devoted fans of the Carry On films to people who simply love Barbara Windsor. During her long career, she was renowned for her down-to-earth nature, great sense of humour and superb acting ability.
"She was a true professional. It seems very apt that a bikini that caused her so much embarrassment during the filming will now go to such a good cause."
According to the auction house, the Carry On Camping wardrobe department would have commissioned duplicate bikinis for the film, but this was the only example known to have survived after it was rescued from a bin during a costumier's stock clearance.
Kate Lee, chief executive of Alzheimer's Society, said: "Dame Barbara Windsor inspired so many when she spoke out about her dementia diagnosis and we are so incredibly grateful to have had her and her husband Scott's unwavering support - what they achieved for people with dementia has been truly awe-inspiring.
"It is fantastic that such an iconic item will continue Dame Barbara's legacy to support people affected by dementia, and we are touched by the generosity of the vendor."