HHS spokesman Aaron Albright said the website component that was breached had been used for testing and did not contain consumer information, such as names, birth dates, Social Security numbers and income details.
The initial intrusion took place July 8, but it was not detected until Monday of last week during a manual scan of system logs. HHS said the component that was breached did not have a firewall, or intrusion detection software, installed on it. Technicians manually scanning logs discovered the breach Aug. 25 and took action.
The Homeland Security Department, which helps safeguard federal systems, said the scope of the attack was limited to one server. There is no evidence an attack was subsequently launched from the tainted machine.
Federal computer systems are the targets of hundreds of cyberattacks every day, but this is believed to be the first successful one involving HealthCare.gov.
The health care site had numerous technical problems when it was launched last fall and was initially unworkable for most consumers. Among the issues that concerned the government's own technical experts was that security testing could not be completed because the system was undergoing so many last-minute changes. HealthCare.gov eventually passed security certification.
"Sadly, the news that HealthCare.gov has been hacked does not come as a surprise," Rep. Joe Pitts, R-Pa., said in a statement. Pitts chairs a panel that held hearings last year on the website problems. Like other congressional Republicans, he opposes President Barack Obama's healthcare overhaul.
HHS says it does not appear that the insurance site was specifically targeted. Rather, the hackers seem to have been probing numerous government and private websites for potential weaknesses.
The department's inspector general is coordinating with other law enforcement agencies to investigate.
HealthCare.gov is the online gateway to subsidized private health insurance for people who don't have access to a health plan on the job.
Created under Obama's health law, the site currently serves 36 states and more may be added when open enrollment starts Nov. 15. The remaining states run their own insurance exchanges.
The incident was first reported by The Wall Street Journal.