Community Health Systems Inc. said Monday that its computer network was a target of an external criminal cyberattack in April and June that affected data related to some 4.5 million individuals.

The rural hospital operator and cybersecurity firm Mandiant believe the attacker was an "Advanced Persistent Threat" group originating from China, it said. The attacker, which used highly sophisticated malware and technology to attack the company's systems, was able to bypass Community Health Systems' security measures and...