Community Health Systems Inc. has agreed to sell Memorial Hospital of Salem County to Prime Healthcare Foundation, the nonprofit arm of Prime Healthcare Services Inc.

The price for the 126-bed hospital in Mannington Township was not disclosed. The deal is expected to close by June.

Salem County community leaders and New Jersey politicians feared a year ago that the hospital, which Community bought in 2002 for $34 million, was on the brink of closing. The deal with Prime, which specializes in buying struggling community hospitals, means that is unlikely to happen.

Prime has at least one additional deal pending in New Jersey. A U.S. Bankruptcy Court judge last month approved Prime's bid to buy St. Michael's Medical Center in Newark.

In the Philadelphia region, Prime owns Roxborough Memorial and Lower Bucks Hospitals and is scheduled to complete the purchase of Mercy Suburban on Jan. 1.

Prime, based in Ontario, Calif., and its affilated foundation own 38 acute-care hospitals in 11 states.