Hospital operator Universal Health Services (UHS) scooped up mental-health facilities operator Psychiatric Solutions (PSYS) in a $2 billion all-cash deal on Monday that places a 3.4% premium on Psychiatric’s stock.

The deal, which also includes about $1.1 billion of Psychiatric’s debt, puts an end to a bidding war with Bain Capital.

Minnesota-based United Health said it will pay $33.75 a share for Psychiatric Solutions, which is the largest standalone operator of freestanding psychiatric inpatient facilities in the U.S. Psychiatric’s shares closed at $32.63 on Monday.

“This transformative transaction is very compelling for shareholders, patients and employees of both companies,” Alan Miller, CEO of UHS, said in a statement. “The combined company will have ample opportunities for further growth in both the acute care and behavioral health care sectors.”

United Health said it expects the deal to generate $35 million to $45 million in annual cost synergies within three years of closing. United also sees the transaction being “significantly accretive” to its earnings per share.

Shares of United Health soared to an all-time high in the wake of the deal. The company’s stock was up 8.24% to $42.25 in recent trading, giving it a 28% gain on the year. On the other hand, Psychiatric’s shares slid 0.55% to $32.42 as the stock had jumped more than 50% year-to-date.

Debt financing for the acquisition is expected to be financed by JPMorgan Chase (JPM) and Deutsche Bank (DB). Goldman Sachs (GS) advised Psychiatric’s board on the deal.