Facebook has announced that it will warn users if they are being targeted by cyber attackers sponsored by state.

The social media giant has announced the change in policy through a post saying that it will notify its users if their account is being targeted by hackers on behalf of government agencies.

Facebook chief security officer Alex Stamos said in a blog post: "While we have always taken steps to secure accounts that we believe to have been compromised, we decided to show this additional warning if we have a strong suspicion that an attack could be government-sponsored.

"We do this because these types of attacks tend to be more advanced and dangerous than others, and we strongly encourage affected people to take the actions necessary to secure all of their online accounts."

Stamos continued: "It’s important to understand that this warning is not related to any compromise of Facebook’s platform or systems, and that having an account compromised in this manner may indicate that your computer or mobile device has been infected with malware."

If there is suspicious activity found in any account, the social media giant will notify users to turn on their ‘Login Approvals’.

Once the ‘Login Approvals’ are turned on, the users will be asked to key in a security code sent by Facebook, to ensure the security of their account.

A similar service was earlier introduced by Google in 2012 to prevent third parties from unauthorised use of accounts.