Governor Deval Patrick, in a State House ceremony packed with hospital executives, healthcare advocates, and lawmakers, signed a sweeping bill today that seeks to rein in the state’s spiraling health costs.

The first-in-the nation legislation is considered the second phase of the groundbreaking universal health care law that was signed by former governor Mitt Romney in 2006.

The new law allows health spending to grow no faster than the state’s economy through 2017. For five years after that, spending would slow further, to half a percentage point below the growth of the economy, although leaders would have the power under certain circumstances to soften that target.

Advertisement - Continue Reading Below

“We are ushering in the end of the fee-for-service care system in Massachusetts in favor of better care, at lower cost,” Patrick said to applause from a stage in Nurses Hall that was decorated with the flags of Massachusetts and the United States.

In an interview, Patrick said Romney deserved credit for launching the state on the path to universal insurance coverage.

“Health care reform has done a lot of good for a lot of people in the Commonwealth, and if that’s why you serve in government then you should take credit,” he said. “If it were polling better, I bet he would take more credit.”

Romney, a Republican who is challenging Democratic President Obama in this fall’s elections, has vowed to get rid of the national health care reform law that was modeled on the original Massachusetts bill.

House Speaker Robert A. DeLeo, Representative Steven M. Walsh, cochairman of the Committee on Health Care Financing, and Attorney General Martha Coakley also spoke at the ceremony. They all praised the work that industry executives and advocates did in writing the bill.

“It’s law. Congratulations,” Patrick said after he signed the legislation with a series of pens that he then handed to his aides and legislators. The bill was Patrick’s top second-term priority.

Despite the backslapping and hearty talk of collaboration, no one from the state Senate showed up at the bill signing.

Senate President Therese Murray “didn’t want to attend the bill signing without Senator [Richard] Moore, who played a major role in developing the legislation,” said David Falcone, a Murray spokesman.

Moore, the Senate’s lead healthcare negotiator, could not attend because of a previously scheduled commitment with the National Conference of State Legislatures, Falcone said.