The Secret History of Georgian London: How the Wages of Sin Shaped the Capital. By Dan Cruickshank. Random House: 688 pages; £25. Buy from Amazon.co.uk

AS MANY as one in five young women were prostitutes in 18th-century London. The Covent Garden that tourists frequent today was the centre of a vast sex trade strewn across hundreds of brothels and so-called coffee houses. Fornication in public was common and even children were routinely treated for venereal disease. A German visitor observed a nation that had overstepped all others “in immorality and addiction to debauchery”.

English society expected, even encouraged, men to pay for sex. Prejudice barred women from all but menial jobs. Prostitution at least offered financial independence: a typical harlot could earn in a month what a tradesman or clerk would earn in a year. For a few beautiful and savvy women, the gamble paid off. Lavinia Fenton, a child prostitute, married a duke. But most prostitutes were destined for disease, despair and early death.

The sex trade transformed Georgian London. Rich brothel-keepers fed a construction boom that spawned thousands of elegant villas in Soho and Marylebone to house up-market courtesans. Dan Cruickshank, whose last book was “Adventures in Architecture”, tells the story well, with many anecdotes. But some of his best chapters are devoted to the efforts to curb the general licentiousness.

Puritanical societies for “the suppression of vice” encouraged punitive laws against disorderly houses and streetwalking. Writers, such as Henry Fielding and Samuel Johnson, drew attention to the prostitutes' plight. John Gay's 1728 play “The Beggar's Opera” mocked the hypocrisy of lecherous aristocrats and politicians.

Thomas Coram's Foundling Hospital opened in 1741 to look after the abandoned babies of unmarried mothers, attracting support from the cream of society. By mitigating the cost and shame of unwanted pregnancy, the hospital hoped to stem the march of women into harlotry. But limited places provoked riots, and the hospital could not, as it had intended, single out the children of mothers who were not harlots.

In 1756 the government gave the hospital money to expand capacity on condition that it accept all children under two months old, with no questions asked. The results were grisly. Despairing mothers across England paid dubious businessmen to offload their unwanted babies on the state: many were lost or dead on arrival. Some three-quarters of the 15,000 babies that reached the hospital died before the government ended its support in 1760.

Magdalen House, a school for “penitent prostitutes” founded by City merchants, tried to reform the women. Successful applicants endured an ascetic routine of prayers and work from six in the morning until ten at night. School records claim that two-thirds of the 14,000 women admitted from 1758 to 1916 were “reclaimed”.

Prostitution's hold on London, as elsewhere, eventually weakened. Mr Cruickshank's readers are left to ponder whether the main reason for its decline was a diminution of demand or greater economic opportunities for women.