SEATTLE — Microsoft took control of 99 websites that it said Iranian hackers had used to try to steal sensitive information from targets in the United States, according to court documents unsealed Wednesday.

By taking over the sites, Microsoft can stop future cyberattacks and monitor how previously infected computers were compromised, the company said.

The hackers “specifically directed” their attacks on people in Washington, Microsoft said in the filing. The hacking group typically has targeted the personal email accounts of people working in both the public and private sectors, including dissidents and workers in government agencies, Microsoft said in court documents.

People working in the Treasury Department and similar agencies in other Western governments were among those targeted, according to a person with knowledge of the attacks who spoke on the condition of anonymity.