Image caption Google earns millions of pounds from its online advertising service, AdWords

Google is profiting from ads for illegal products generated by its flagship automated advertising system, the BBC has found.

The ads include unofficial London 2012 Olympics ticket resellers, as well as cannabis and fake ID card sellers.

These ads were promptly removed by Google after the BBC brought them to the company's attention.

Google has also taken down links to illegal Olympic ticket resellers following requests from the police.

But the search giant told 5 live Investigates that the company keeps any money it might make from companies advertising illegal services before such adverts are removed.

Selling tickets on the open market without permission from the Olympic authorities is a criminal offence in the UK under the London Olympic and Paralympic Games Act 2006.

Not official sellers

Liz, who declined to give her full name, contacted the 5 live Investigates team.

When we are informed of ads which break our policies, we investigate and remove them if appropriate Google

"Me and my sisters decided to club together to buy our mum and dad some Olympic tickets," said Liz, who is from Solihull.

"So we typed into Google 'Olympic tickets' and at the very, very top of the page was a link to a company called LiveOlympicTickets.

"It was a sponsored ad at the top of the page, so we presumed it was a trusted official site, and we spent £750 on two tickets for my mum and dad to see the 1500m, which is what my dad really wanted."

The advert Liz clicked on was one placed by Google's own AdWords advertising service - one of the company's main sources of income.

However, after placing her order, Liz received an email from the company informing her that they could not complete the sale until she faxed over a copy of her signature.

"That's when alarm bells began ringing," said Liz.

LiveOlympicTickets is not an officially recognised 2012 Olympic ticket reseller.

A family member of Liz's wrote to Google, and received this reply:

"While Google AdWords provides a platform for companies to advertise their services, we are not responsible for, nor are we able to monitor the actions of each company."

Promoting ticket touts

The Metropolitan Police, which is dedicated to stopping crime associated with the 2012 games through Operation Podium, said it is aware of LiveOlympicTickets and that the company is breaking the law.

Image caption It is a criminal offence in the UK to sell London 2012 Olympic tickets without the organisers' permission

However, as the company is registered overseas, it may be difficult to prosecute as it is outside the UK's jurisdiction.

The maximum penalty fine for reselling Olympic tickets without authorisation from the Olympic authorities was raised last year from £5,000 to £20,000.

Despite this, Google has placed adverts for unofficial ticket resellers which are breaking the law by selling London 2012 tickets to customers in the UK.

In this case, LiveOlympicTickets was Google's top sponsored link for 2012 tickets - and remained so for more than a week even after the Metropolitan Police had asked the search engine to remove the advertisement.

The company link was finally removed after 5 live Investigates contacted Google.

But research by the programme team found other sponsored Google adverts - for online cannabis sellers, fake ID cards, and fake UK passports.

Automatic advertising

But why do these adverts appear in the first place?

Google's advertising system is partly automated and this helps make the initial selection of the advertisements which appear at the top of its search results.

Find out more Image caption Shoppers are warned that sponsored links do not mean a company is operating above board Listen to the full report on 5 live Investigates on Sunday, 8 January at 21:00 GMT on BBC 5 live or download the podcast Download the 5 live Investigates podcast Got a story that needs investigating? Follow 5 live on Facebook

Google's AdWords does filter key words that can help sift out adverts which might be offering unlawful services.

If a filter flags an advert, then Google will run a manual assessment - a human takes a look - and if it breaks Google's policy, the advert will be taken down.

In a statement, Google said: "We have a set of policies covering which ads can and cannot show on Google. These policies and guidelines are enforced by both automated systems and human beings.

"When we are informed of ads which break our policies, we investigate and remove them if appropriate.

"Our aim is to create a simple and efficient way for legitimate businesses to promote and sell their goods and services whilst protecting them and consumers from illicit activity."

Buyer beware

However, dubious online retailers are still finding their way to the top of the advert results and can do so by paying a higher cost per click than other advertisers.

Google says the quality of ads also plays a role in the ranking advertisers achieve, as well as the price the advertiser is willing to pay.

London 2012 - Begin your journey here London 2012: Latest Olympic news, sport, features and programmes from the BBC

"Relying on an automated process is remarkably lax and typing key words into Google can show up illegal sites quite quickly," says online security adviser, Reg Walker.

"We carried out an experiment around six months ago trying to knock a ticket scam site off the top of the Google AdWords results and we went up to £28 per click and we still couldn't shift it from the top."

Mr Walker is also critical of Google's response to removing adverts offering unlawful services.

"There's an automated complaint form, which gets an automated reply, which lets you know you're in a queue, and eventually a human being will get around to scrutinising it and do something about it," he said.

"The site could stay up for days, weeks, or possibly even months."

'Check the site'

After making her purchase, Liz asked LiveOlympicTickets for a refund for the tickets she purchased and was told this was not possible.

She also contacted her bank to try and stop her purchase, and for the time being they have credited her the money she spent while they carry out their own investigation.

She has since purchased more tickets from a legitimate seller, but may still lose £750, depending on the findings of her bank.

Google did promise to investigate the case further, but Liz admitted she did not respond to this offer as she was more concerned with getting her money back.

Google's sponsored links have proved costly in the past and, in August, Google agreed to forfeit $500m (£324m) for publishing online adverts from Canadian pharmacies selling illegal drugs to US customers.

Reg Walker warned consumers to be cautious about buying from companies they have not previously heard of and which show up as sponsored links.

"Check out the site thoroughly. If it has no trading history, no substantive company address, no VAT number on it, don't go near it," he said.

"If it has an address, use Google itself to find that address - if the address is for a mailing service, or a mail box then, again, don't go near the business."

"Just because it appears to have the weight of Google behind the advertisement, it doesn't mean it's legitimate - it can be quite the opposite."

5 live Investigates broadcasts on Sundays at 21:00 GMT on BBC 5 live. Hear more by downloading the 5 live Investigates podcast.