Image copyright HM Government Image caption The government's MyTown campaign

The government has been accused of using public funds to target voters in key general election constituencies with Facebook ads.

The ads say: "the Government is investing up to £25m" in the town where the message appears on Facebook feeds.

They went live on Tuesday - the same day Boris Johnson secured support for an early general election.

Labour MP Ian Lucas called it an "outrageous" misuse of public funds, according to The Huffington Post.

The seventeen adverts are part of the government's "MyTown" campaign on Facebook.

Several of the towns, such as Northampton, Milton Keynes and Mansfield, are home to constituencies that will be key battlegrounds in the general election, with majorities of less than 2,000.

The campaign promotes the government's £3.6bn Towns Fund, which aims to increase investment in neglected parts of the country.

Image caption The Facebook ads used for the government's MyTown campaign

The ads, paid for by taxpayers, are not marked as being about "social issues, elections or politics". This is the system that Facebook has put in place to help with the transparency of social and political ads on its platforms.

Other adverts by the UK government, such as the "Get Ready for Brexit" campaign, are flagged in this way.

Not flagging them also means they disappear from the Facebook Ad Library once they are no longer active - and that it is not possible to find out how much the government has spent on them.

Two of the ads have now been taken down after Facebook determined they were "about social issues, elections or politics" and required the disclaimer.

Facebook's policies around political advertising have come under scrutiny in recent days as Twitter announced it would ban all paid political messages.

Analysis

Image copyright Reuters

By the BBC's Paul Sargeant

Facebook has about 40 million users in the UK and most of the content people see on site is from their friends or pages they have liked.

Anyone can also pay to have content shown to people who haven't liked their page - and they can chose who sees this paid-for content by targeting things like gender, age, location, or interests.

Political parties also use this paid-for content to reach new people. The difference is Facebook ask that any content about "about social issues, elections or politics" is labelled by the organisation posting it.

This political content is archived and can be searched for in the Facebook Ad Library. Meaning for every political advert it's possible to check who paid for it and get a rough idea of who has been shown the ad and how many times it has been seen.

However, the system of labelling political adverts is voluntary. If an organisation fails to label their paid-for content, the adverts are only searchable while they are active on the site.

This loophole could allow political organisations to hide old adverts or at least make them much harder to find.

Mr Lucas has written a letter to Cabinet Office minister Michael Gove demanding to know how data for the campaign was gathered and accusing the government using public money for political purposes.

"It is quite clear that those constituencies are, largely, politically contentious.

"These marginal constituencies appear to have been selected on a political basis," his letter said.

He told the Huffington Post: "It is an example of how the government is merging political activity with the arms of government in its own political interest."

'Drop in the ocean'

Labour's Shadow Communities Secretary Andrew Gwynne said the proposed cash injection was a "drop in the ocean compared to the billions the Conservatives have cut from local communities".

A government spokesman told the BBC that ministers would respond to Mr Lucas' letter, but added: "These posts were published before the election was called and Parliament has not yet been dissolved.

"All towns selected were chosen according to the same selection methodology, including analysis of deprivation, exposure to Brexit, productivity, economy resilience and investment opportunities."

The government has been the biggest UK spender on Facebook political adverts in the last month.

The most recent figures available on Facebook's ad library site cover spending between 22 and 28 October and show that the government spent £192,753 in that period. All of the spending was on ads promoting the Get Ready for Brexit campaign.

In second place was the People's Vote campaign for another EU referendum with spending of £52,234.