Image copyright Getty Images Image caption It was the second time in one week the popular site went down

Facebook has restored access to its website after a 40-minute outage on Monday, the second time in a week that the site has gone down.

Users saw an error message that read "Sorry, something went wrong. We're working on it and we'll get it fixed as soon as we can."

Company shares were down nearly 4% at $89.25 (£58.83) shortly after the site went down. It also crashed on Thursday.

The social networking site is used by nearly 1.5 billion people worldwide.

Dave Lee, BBC North America technology reporter

All right, all right - the world is still spinning. But Facebook going down twice, in a relatively short timeframe, can be fairly significant. It moves markets - Facebook share price is down almost 4% as I write this.

The company's status page detailed a "major outage" on Monday, but things were soon back to normal.

A quick post-mortem, posted by an engineer at the company, said the problem was with its Graph API. In simplest terms, the "graph" is the term Facebook uses to describe the core of Facebook's system. Posts, photos, statuses are all connected to people, groups and pages via the Graph - and that's what failed.

Sometimes Facebook downtime can also affect other companies that tap into Facebook's data - like Tinder, for example.

The last time this happened, Facebook admitted it was something its own engineers had caused by tinkering. That's likely the case again here, but twice in a week will be a little frustrating for both users and shareholders.

Follow Dave Lee on Twitter @DaveLeeBBC

People took to Twitter to lament and poke fun at the situation.

The Kingston police force in London pre-empted emergency cold turkey calls, with tongue firmly in cheek.

Image copyright Twitter

Sites that monitor disruptions said North America was particularly badly affected this time.

"We are currently restoring Facebook services that people had trouble accessing earlier today due to a configuration," said a Facebook spokesman.

Some users took to speculating about the cause.

Image copyright Twitter

Others sarcastically bid the site good riddance.

Image copyright Ashley Gold

And some enjoyed underlining that Facebook's loss was Twitter's gain.