Four Houston-area HCA hospitals have agreed to pay $8.6 million to settle allegations that they received kickbacks from several ambulance companies in exchange for Medicare and Medicaid business referrals, federal officials said Wednesday.

Bayshore Medical Center, Clear Lake Regional Medical Center, West Houston Medical Center and East Houston Regional Medical Center all allegedly made arrangements with unnamed ambulance companies to provide patients with free or heavily discounted transportation. In exchange, the HCA hospitals referred their Medicare and Medicaid business to those ambulance companies, according to the U.S. Justice Department.

Without those kickbacks, the hospitals would have had to pay significantly more for the services, the Justice Department said.

"This settlement emphasizes that both sides of any arrangement where remuneration is paid in exchange for healthcare referrals are responsible for their improper actions—even entities that do not actually bill Medicare or Medicaid for the services," Gregory Demske, HHS' chief counsel, said in a statement.

"Any company or individual receiving anything of value in exchange for referrals should understand that their actions may have serious legal and financial consequences," he added.

HCA's Gulf Coast division said Wednesday that the hospitals had and continue to have robust compliance programs.

Wednesday's announcement marks only the second time the U.S. attorney's office in Houston has held a provider responsible for their involvement in a ambulance-swapping case, according to the Justice Department. In 2015, the office reached a $3.2 million settlement with a Galveston, Texas-based skilled nursing facility company for a similar kickback arrangement.

In the past, the Justice Department settled swapping cases with the ambulance companies rather than homing in on hospitals' involvement in the deals.