Facebook has said it will block ads relating to Ireland's forthcoming referendum on abortion that do not originate from advertisers inside the country.

There had been worries that foreign ads could influence the result of the vote.

Facebook has not applied such a policy to British elections or referendums.

A 25 May referendum could repeal the Eighth Amendment to the Republic of Ireland's constitution, which states "the right to life of the unborn".

It means that the country has a near-total ban on abortion, with terminations not allowed in cases of rape or incest, for example.

In April, Irish data protection commissioner Helen Dixon said it was possible that foreign actors could try to sway the referendum.

Reports in The Times newspaper's Ireland edition had also highlighted the problem.

Facebook said that its ban on ads not from the Republic would be effective from 8 May. The company will rely partly on reports from campaign groups that identify such ads.

It added that such a policy would also apply to future elections in the country.

Ads uploaded to Facebook by organisations based in the country could still be funded by foreign sources, however.

"This is an issue we have been thinking about for some time," said Facebook in a statement, referring to the Eighth Amendment referendum.

"Today, as part of our efforts to help protect the integrity of elections and referendums from undue influence, we will begin rejecting ads related to the referendum if they are being run by advertisers based outside of Ireland.

"We feel the spirit of this approach is also consistent with the Irish electoral law that prohibits campaigns from accepting foreign donations."

The firm added that it intended to provide an open platform "for people to express ideas and views on both sides of a debate".

In April, Facebook announced it would vet ads relating to the UK's local elections, which took place earlier this month.

However, this action did not extend to blocking ads simply because they had been placed by foreign organisations.

A spokeswoman for Facebook told the BBC that the social media site did not have any similar plans in other countries to make public at present.

She added, "We are looking closely at all elections and determining what steps we can take."