(Reuters) - TeamHealth Holdings Inc (>> Team Health Holdings LLC) agreed to buy IPC Healthcare Inc (>> IPC Healthcare Inc) for $1.4 billion to gain exposure to the Medicare bundling program and take on more medical staff for supply to nursing homes in the United States.

The deal will allow TeamHealth, which provides contract workers for emergency rooms and hospitals, to expand into IPC's specialist area of post-acute care, such as nursing homes and assisted-living facilities.

IPC's shares touched a record high on Tuesday, trading just below the offer price at $79.57. TeamHealth's stock was down 3 percent.

TeamHealth's merger with IPC comes at a time when the U.S. healthcare system is moving toward a value-based reimbursement system through the Medicare bundle payment program.

Traditionally, Medicare makes separate payments to providers for each individual service over the course of treatment. The "bundled payments" initiative aims to link payments for multiple services during an episode of care.

TeamHealth is now in a position to bundle up its services and build a full-service presence across the entire care continuum, from emergency care and anesthesia management to specialist services and post-acute care, Leerink Partners analyst Anagha Gupte said.

The healthcare system has seen a major consolidation among hospitals and doctor practices. Kindred Healthcare Inc (>> Kindred Healthcare, Inc.) bought Gentiva Health Services last year, while Skilled Healthcare Group Inc bought privately owned Genesis HealthCare.

Health insurers have also hopped onto the bandwagon with two big-ticket mergers in July, along with medical device makers and other suppliers, which are also combining rapidly.

TeamHealth is offering $80.25 for every IPC share, a premium of 37.3 percent to IPC's Monday closing price of $56.46.

The equity portion of the offer is valued at $1.4 billion, according to Reuters calculations based on 17.39 million IPC shares outstanding as of June 30.

The all-cash offer has an enterprise value of about $1.6 billion, the company said.

"We believe it is unlikely that the deal will have FTC issues considering that both ER and hospital-based medicine are fragmented businesses," Wells Fargo analyst Gary Lierberman wrote in a note.

The combined company is expected to have a network of 15,000 healthcare professionals.

The deal, likely to close in the fourth quarter, is expected to modestly add to TeamHealth's adjusted earnings in 2016.

Citi and MTS Health Partners served as financial advisers to TeamHealth, while Credit Suisse advised IPC.

Simpson Thacher & Bartlett LLP was TeamHealth's legal counsel, while Sidley Austin LLP was IPC's legal counsel.

(Reporting by Amrutha Penumudi in Bengaluru; Editing by Don Sebastian and Saumyadeb Chakrabarty)

By Amrutha Penumudi