It didn’t look like it was going to happen, but a bill that would make it easier for private, for-profit hospitals to take over nonprofit hospitals was on its way to the governor’s desk late Wednesday.

The so-called hospital conversion bill would help for-profit hospitals, like Texas-based Tenet Healthcare Corporation, come into Connecticut and acquire physician practices without being in violation of current law.

The issue was so complicated and involved so many varied interests that it looked at times like lawmakers were content to ignore it.

“We could have done nothing and sat back and waited to see what happens in the corporate world with private hospitals and foundations,” Sen. Len Fasano, R-North Haven, said.

But that’s not what happened.

“With this piece of legislation, we are in control of our destiny,” Fasano said during a brief debate on the bill.

Fasano has been concerned about hospitals like Yale-New Haven Hospital gobbling up independent physician practices through a medical foundation.

The ability to acquire these physician practices is one of the many reasons Tenet needed the legislation to do business in Connecticut. The lobbyists for the Texas-based corporation were at the table when the bill was being drafted, but after the bill passed the organization teamed up with Yale-New Haven Hospital to release a statement signaling that they were not happy with the legislation.

“If this bill becomes law there is clearly a chance that there will be some unintended consequences — ones that could make it extremely difficult for us to partner with hospitals in Connecticut to provide quality patient care,” Vin Petrini, senior vice president of public affairs at Yale New Haven Hospital, and Trip Pilgrim, senior vice president of development for Tenet, said in a joint statement. “As we’ve said all along, we believe the current process for the conversion of nonprofit hospitals contains sufficient safeguards — ones with which we are happy and proud to comply.”

The statement upset lawmakers like Fasano because it was his understanding that there was an agreement.

“They’re shameless,” Fasano said. “I have no respect for them. None.”

Rep. Sean Williams, R-Watertown, said they had a handshake and a deal with the representatives of the hospitals and it’s “outrageous” they would put out a statement like that.

Paul Filson, political director of SEIU 1199 New England, said that when it became clear something was going to happen they did what they could to make sure there was enough protections for workers and the communities.

Filson was among a handful of lobbyists last year who were close to a physical confrontation on the final night of the legislative session regarding a medical foundation bill that Gov. Dannel P. Malloy eventually vetoed. That bill would have prescribed who would be able to be on the board of a medical foundation.

“We feel this had enough protections in it that we could live with it,” Filson said.

He also pointed out that there’s always time to come back next year if they need to make changes since these deals don’t happen overnight.

Malloy administration Chief of Staff Mark Ojakian, who helped broker the deal on the bill, said he doesn’t believe any of the stakeholders are necessarily happy, but he felt that it needed to get done.

“Shuttle diplomacy,” Ojakian said. “Everyone was talking, but not to each other.”

Attorney General George Jepsen warned lawmakers at the end of April that the relationship Tenet developed with Yale-New Haven Hospital was not acceptable as a work-around for the current situation, which doesn’t allow for-profit entities to have medical foundations. It’s through those foundations that physician practices are acquired.