People are silhouetted as they pose with mobile devices in front of a screen projected with a Facebook logo, in this picture illustration taken in Zenica October 29, 2014 / REUTERS/Dado Ruvic

The company has committed to resolve the issue with its Safety Check tool, which has received sustained criticism in recent weeks and months

Facebook has apologised for sending texts people across the world asking if they were “affected by the explosion”.

The site turned on its controversial Safety Check tool in the wake of a bomb in Lahore that killed at least 52 people and injured many more, most of whom were women and children in a park.

But the tool appears to have gone wrong and sent people a text message asking whether they were affected by the explosion – without naming the location – even if they were thousands of miles away.

The feature is intended to use a data and an algorithm to work out where Facebook users are. If it think that a person is or could be in an affected area then it will send a message asking whether they are safe.

But a problem with the site’s tool meant that the same message was seen by people as far away as UK and the US.

The company confirmed the issue and said that it was working to fix it.

"We have activated Safety Check in Lahore,” said a Facebook spokesperson. “We apologise to anyone who mistakenly received a notification outside of Pakistan and are working to resolve the issue."

Many people had tweeted to complain about the texts.