When cops swooped on the posh flat owned by a brothel boss dubbed Madam Moneybags, they soon discovered how much cash could be made in Edinburgh’s sex-for-sale businesses.

Officers found mountains of expensive handbags, clothes and jewellery which formed part of Margaret Paterson’s £500,000 spending spree on designer goods.

The pensioner, who died last year, was the latest in a long line of colourful figures to profit under the city’s more relaxed attitude to prostitution.

Brothels, saunas and massage parlours were kept busy over the decades while streetwalkers continued to ply their trade.

Margaret Paterson and lover Robert Munro were jailed for their role with brothels

Now with the rise of websites allowing vice girls to advertise online, many work alone from hundreds of private flats.

But Paterson – like others in the sex trade – also learned the authorities won’t always turn a blind eye.

And – as many women who have worked in that world attest – it can be a dangerous way to put food on the table.

Between the end of World War II and the 70s, Dora Bryce became Scotland’s most famous madam running a brothel in Danube Street in the New Town.

About 15 women worked at the premises where immaculately dressed Bryce played host.

The place was a big draw for visiting American sailors who could be sure of spending much of their wages there.

Bryce was permitted to continue running the brothel as it was rarely a source of trouble, although she was arrested regularly.

It’s estimated her line of work led to 47 encounters with the law and, aged 71, she was jailed for four months in 1972 for living off immoral earnings.

Bryce, who died in 1977, was always keen to speak to the media, adding further to her notoriety.

Carol's Sauna on Easter Road was one of many similar establishments

She boasted how the Edinburgh Festival period gave Danube Street its busiest time of the year followed by the weeks of the General Assembly of the Church of Scotland.

Although the Danube Street brothel went out of business not long after her passing, the liberal outlook of its leaders meant Edinburgh’s sex industry would soon be flourishing.

In 1982, it became the first city in the UK to effectively decriminalise brothels by granting saunas and massage parlours entertainment licences.

The move was partly to cope with challenges brought by the HIV epidemic, which hit at the start of the decade, and meant the premises were subject to regular fire and police checks.

Entrepreneurs were quick to realise profits from this new business opportunity while members of the criminal underworld where also known to be early investors.

The number of saunas more than doubled between 1990 and 2000, rising from 12 to 27, with as many as 15 women working at one time in some establishments.

The local authority allowed them to operate by not asking too many questions about what went on behind closed doors.

Several saunas in Edinburgh were raided by police in 2013.

In one letter to an anti-sauna campaigner, a high-ranking council official wrote: “I would completely refute any suggestion that the council are aware these licensed premises carry on as brothels.”

One senior councillor described this official response as a “bit silly”. But despite the authorities willing to look the other way, the seedy reality of saunas was never far away.

In the 90s, one sauna owner was prosecuted for living off immoral earnings, with a court being told that two 15-year-old girls, sometimes wearing their school ties, had worked there.

Along with the saunas dotted among shopfronts on its streets, Edinburgh would become home to the Fantasy Bar – Scotland’s first lapdancing venue.

Other strip venues would follow, helping to make Edinburgh’s Grassmarket area a top destination for stag parties.

About half a dozen X-rated sex stores peddling hardcore pornography, erotic clothing and “marital aids” also sprung up.

By the millennium, it was estimated that about 1000 women were involved in the city’s sex industry, working in saunas and stripclubs as well as street prostitution.

Vice girls working Edinburgh’s streets had the benefits of a so-called “tolerance zone” in parts of Leith from the mid-80s.

Police would turn a blind eye as long as the prostitutes stayed in the area.

Some of these women sold their bodies to fund drug addictions while the danger of working in this manner were constant.

Sheila Anderson, a well-known prostitute from Leith, was out on the streets when she was murdered in April 1983 in a case which has never been solved.

But in 2007, new laws against kerb-crawling saw dozens of men arrested in the first year, stoking fears that the women would be forced to go “underground” into isolated locations to avoid police attention.

Meanwhile, Margaret Paterson was able to grow her escort business with the help of the internet, running a website where her call girls posed for photos.

They considered well-spoken Paterson as the boss with her former lover, Robert Munro, her second-in-command.

Paterson was known to give her hookers advice on domination for clients who wanted to be submissive.

Police discovered Paterson and Munro were in charge of prostitutes in Edinburgh, the Lothians, Glasgow and Aberdeen.

Police found mountains of designer goods and bundles of cash when they raided Margaret's home

Sixty-five vice girls worked from the New Town basement flat for nine years.

They were sent out to meet clients at their homes and hotel rooms, while men visited the address for “in-calls” at a Grosvenor Street brothel to choose an escort and pay for sex.

The racket came crashing down after a police raid in September 2011.

Paterson was jailed in July 2013, with Munro handed a five-year term.

She was later slapped with a court order to stump up £1million under proceeds of crime laws. Later, the saunas would face a crackdown by cops.

In June 2013, dozens of officers staged raids at saunas and several people were charged with brothel-keeping and living off immoral earnings.

But while the sauna trade was under pressure, prostitutes flocked to the city to work from private flats.

By August 2013, it was estimated that nearly 300 women were advertising sexual services, mostly on websites.

Megara Furie, secretary of the GMB union’s adult entertainment branch who herself works as a dominatrix, said financial pressures may be forcing the women to work.