Britain's Parliament was hit by a "sustained and determined" cyberattack 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 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.