It was the 18th-century equivalent of Live Aid - a charity that showcased the leading musicians and artists of the day while raising money for some of the most vulnerable children in society.
The Foundling Hospital in London was the first institution to take in and care for illegitimate children, who had previously been left to die on the streets or had grown up tainted with the stain of being born a bastard. The charity was to become one of the most fashionable causes to support, and the artworks donated to it laid the foundations for the establishment of the Royal Academy.
The hospital has now been turned into a museum dedicated to the history of the foundlings as well as displaying its rich collection of 18th-century art. Funded with more than £3m of lottery grants and donations from modern philanthropists such as Paul Getty, the museum will open later this month.
The hospital was founded by Captain Thomas Coram, a retired sailor, who was shocked to see babies dying on the capital's streets when he returned to Britain from America in 1704. In the early 18th century, the opprobrium heaped on single mothers and illegitimate children meant that more than 1,000 babies a year were abandoned on the streets of London alone. The majority died where they had been left; some were taken into workhouses, where many starved to death.
Sir Thomas was a self-made man from Dorset who established a lucrative shipyard but believed that his humble origins and time in America had left him excluded from London society. Married but childless, he was determined to do something to help the abandoned babies he walked past on his trips into town.
But his reasons were not entirely altruistic. Having come from America, where there was a labour shortage, Coram realised that the foundlings represented a huge untapped workforce who could be trained to fill the employment gap.
He joined forces with the artist William Hogarth, another childless man who felt he was on the outskirts of polite society, and began writing begging letters to the wealthy and influential in an attempt to set up a hospital for the foundlings.
The idea was unpopular at first - some opponents claimed it would encourage "fornication, adultery and incest" - but Coram crucially won the support of George II's wife Caroline, and in 1739 the Foundling Hospital was established by royal charter.
At the time, there were no public art galleries or concert halls, and painters and musicians had to rely on patronage to show their talents. Coram offered artists space to display their works in the hospital - if they donated them to the charity. Hogarth gave the first endowment - a painting of Coram - and persuaded friends such as Joshua Reynolds and Thomas Gainsborough to do likewise. The composer George Frederic Handel became a governor as well, and raised money by giving annual performances of The Messiah at the hospital.
The letters of application written to the hospital by people vouching for women provide an insight into the background of the children who lived there. In 1769, someone vouching for Sarah Harbour explained how she had been raped on a trip to Chelsea: "She was attacked by two men dressed as sailors and dragged violently into a cellar where they abused her in a very shameful and wicked manner ... in consequence of their villainy she unhappily proved with child."
The regime was harsh. Children were renamed, and never told anything about their mother or their background. Women were allowed to leave a trinket or letter to identify themselves if they wanted to reclaim their children but the child was never told that anything had been left.
The babies accepted by the hospital were first fostered out to women in the country until they were four years old, when they were taken from their surrogate mothers and housed in the hospital. Rhian Harris, the museum's director, said: "There was no way that the hospital could look after 400 babies, but it does seem incredibly cruel that, having already been abandoned once, these children are taken from the only woman they had known as a mother."
The hospital moved out of London to Berkhamsted, Hertfordshire, in 1926 and finally closed as a foundling institution in 1953. Incredibly, the practice of placing babies with a foster mother until they were four and then sending them back to the hospital was continued right to the end.
And the taint of illegitimacy which blighted children in the 18th century still persists into the 21st, it appears.
When Ms Harris tracked down some of the last residents of the Foundling Hospital, now in their fifties, some said that they did not want their photographs or details to be displayed on the museum's walls. "I don't want my neighbours to know," one man told her sadly.
The Foundling Museum, 40 Brunswick Square, WC1, opens on 15 June.Reuse content