Facebook is offering political parties direct support to help them win elections.

The social media giant has set up a unit to help politicians with their campaigns as it seeks to boost spending on advertising and increase its own political influence.

Staff members provided by Facebook were embedded in Donald Trump’s campaign to become US president.

Mark Zuckerberg's company, which has over 2 billion users, has a little-known government and politics unit which helps political parties around the world use the site to win and hang on to power (file pic)

The firm has also boasted of helping the SNP ‘achieve an overwhelming victory’ in the 2015 election, when it took 56 of 59 Scottish seats in Westminster.

A former senior employee who ran the European arm of Facebook’s politics unit raised concerns last night about how the firm is working with political parties.

Elizabeth Linder, who quit her job in May last year, said: ‘It’s not Facebook’s job to be so close to any election campaign.’

The firm’s government and politics unit has helped politicians seeking election in countries including the US, India, Brazil, Germany and the UK.

A dedicated page on Facebook's website claims the media giant played a crucial role in helping Nicola Sturgeon's 2015 (pictured last week in the Scottish Parliament) landslide victory

In the US, it offered to second staff members to both Mr Trump and Hillary Clinton’s presidential campaigns, although the defeated Democrat candidate declined to accept this.

Before the UK general election in June, Facebook contacted more than 5,000 candidates and agents to offer them free training sessions. Its emailed invitation to a workshop said it would help candidates ‘understand how to get the most out of our tools for the campaign period and beyond’.

It added: ‘Our free workshop will help provide you with the skills to utilise Facebook best practices for election campaigns, keep your page safe and secure, and make the most of our advertising tools.’

It is understood that while Facebook provided candidates with access to workshops and online seminars, no staff were seconded to UK political parties for the campaign. The SNP’s 2015 general election campaign is heralded as a ‘success story’ on a Facebook website aimed at potential advertisers.

It describes how the party turned the ‘disappointment of the No vote’ in the 2014 Scottish independence referendum into an ‘opportunity’ by capitalising on a ‘groundswell of support’ and leaving the ‘remaining parties with only one seat apiece in Scotland’.

The Facebook page describes the SNP as the 'pride of Scotland' and talks about how the party managed to reach 1.24million people through Facebook with the average ad costing less than a penny.

It adds: ‘Campaigners across the political spectrum now recognise that using Facebook made a demonstrable difference to the election result.’

Facebook staff were embedded in Donald Trump's election campaign (file photo)

Providing direct support to political parties helps Facebook tap into the lucrative political advertising market. The Electoral Commission found the Conservatives spent £1.2million on Facebook advertising during the 2015 general election.

But the firm also risks accusations that it could seek to take advantage of its relationship with politicians to push its own agenda on issues such as internet regulation.

Earlier this month, Facebook was accused of fuelling a tide of vile abuse against Tory general election candidates.

The committee on standards in public life identified social media giants as ‘the most significant factor’ in harassment.

The SNP said last night: ‘Social media is an increasingly important way to speak directly to voters. Digital campaigning is at the heart of our efforts.’ Facebook declined to comment.