Yale-New Haven Hospital won approval from the state’s Department of Public Health for its proposed acquisition of the Hospital of St. Raphael — the last regulatory step needed for the $160 million takeover to go forward.

The Department of Public Health’s Office of Health Care Access signed off Wednesday on an “Agreed Settlement” that will allow the hospitals to merge into a single 12,000-employee entity. Yale New-Haven and St. Raphael’s originally submitted a merger application to the office on Feb. 9.

State Attorney General George Jepsen signed off on the plan on June 1, announcing that he will not seek to block the proposed acquisition on antitrust grounds. Jepsen conducted an investigation earlier this year in coordination with the Federal Trade Commission to determine whether Yale’s acquisition of St. Raphael’s would greatly lessen competition for medical services in the area.

Officials at both hospitals have said the terms of the acquisition would help Yale-New Haven meet excess demand and allow St. Raphael’s to regain financial stability. According to the application submitted to the Office of Health Care Access, Yale needs at least 140 additional patient beds in the next five years to cope with increased demand. At the same time, the Agreed Settlement states St. Raphael’s “volume is down approximately 8 percent in the current year and cannot remain a viable standalone provider of hospital services.”

As part of the agreement, Yale-New Haven will spend $129.5 million on improvements at St. Raphael’s during the first five years following the merger. The combined hospitals will have a maximum patient capacity of 1,477 beds.

The hospitals are expected to close the deal July 27, when the hospitals will begin operating as one.