Aetna Inc. has agreed to settle allegations that it improperly disclosed the protected health information of thousands of Americans, including HIV patients.

As part of the agreement, the insurance giant will pay the state $17 million to plaintiffs in several staets. It also will hire an independent consultant to evaluate and report on its privacy protection practices and monitor its compliance with the settlement.