Around two million Facebook users logged into their accounts on Friday to find out that the social network had declared them dead - even the company's CEO Mark Zuckerberg.

The network accidentally "memorialised" accounts with the message: "We hope people who love Mark will find comfort in the things others share to remember and celebrate his life."

Facebook apologised and said that the glitch was related to the process of "memorialising" someone's page when they die.

While the company wanted to introduce the new message to existing memorial pages, it accidentally applied it to around two million extra accounts.

A spokeswoman told The Guardian: "For a brief period today, a message meant for memorialized pages was mistakenly posted to other accounts.

"This was a terrible error that we have now fixed. We are very sorry that this happened and we worked as quickly as possible to fix it."

The process of memorialising someone's Facebook page involves submitting a formal request and providing evidence such as a death certificate.