The hackers carried out a sustained and determined attack on all parliamentary user accounts in an attempt to identify weak passwords.

Britain’s parliament was hit by a “sustained and determined” cyber attack on Saturday designed to identify weak email passwords, just over a month after a ransomware worm crippled parts of the country’s health service.

The House of Commons said it was working with the National Cyber Security Centre to defend parliament’s network and was confident it had protected all accounts and systems.

“Earlier this morning (Saturday), we discovered unusual activity and evidence of an attempted cyber-attack on our computer network,” an email sent by parliamentary authorities to those people affected said.

“Closer investigation by our team confirmed that hackers were carrying out a sustained and determined attack on all parliamentary user accounts in an attempt to identify weak passwords.”

Britain’s National Health Service was hit by a massive global ransomware worm in May which crippled the computer system and forced some hospitals to turn away patients.

The National Cyber Security centre is part of Britain’s GCHQ spy agency, set up last year to tackle what the government believes is one of the biggest threats to British security.

Chris Rennard, a member of the Liberal Democrat party in the upper House of Lords, was the first to draw attention to the problem, using Twitter to announce: “Cyber security attack on Westminster, Parliamentary emails may not work remotely, Text urgent messages.”