Google Inc is advising its Gmail email service customers in Iran to change their passwords in the wake of a cyberattack that has affected a major swath of the country.

Google itself was not compromised, but the attackers may have been able to break into the link between Gmail and a person's computer, essentially. As such the attack was the latest illustration of the difficulty and complexity of securing the Web.

We learned last week that the compromise of a Dutch company involved with verifying the authenticity of websites could have put the Internet communications of many Iranians at risk, including their Gmail, Google said in a post on its official blog on Thursday.

While Google's internal systems were not compromised, we are directly contacting possibly affected users and providing similar information below because our top priority is to protect the privacy and security of our users, Google said.

A certificate guarantees that a Web surfer is securely connected with a website and not being monitored by someone else.

In mid-July, Dutch Information Technology company DigiNotar's systems were hacked and security certificates were stolen for a number of domains, DigiNotar and its owner, U.S.-listed VASCO Data Security International, said on August 30.

The stolen certificates were immediately revoked after detection of the theft but one, for the site Google.com, was only recently revoked after a warning from the Dutch government, DigiNotar and VASCO said.

Google, which alerted users to the threat last week, recommended on Thursday that all users in Iran follow a series of steps to protect themselves, including changing their Gmail passwords and verifying their account recovery options.

(Reporting by Alexei Oreskovic; Editing by Peter Henderson and Richard Chang)