Less than three months after signing a deal last year to buy Philadelphia Gas Works, the chief executive officer of UIL Holdings Corp. received a secret overture to explore a merger with a Spanish energy firm.

James P. Torgerson, the UIL chief executive, "expressed an interest but indicated that he was focused on completing the PGW transaction and did not wish to enter into any discussions, at that time, that could interfere with its completion," according to a document filed with the U.S. Securities and Exchange Commission.

By December, UIL's deal with PGW had collapsed. And three months later, the Connecticut company agreed to be acquired for $3 billion by Iberdrola USA, the Spanish firm's American subsidiary.

Yet in Philadelphia political circles, interest in the covert courtship of UIL and Iberdrola amid UIL's doomed 2014 campaign to buy PGW lingers.

Though City Council openly jilted UIL months before the company walked away from its PGW bid, Council members regard UIL's sale to Iberdrola with suspicion. In defending their refusal to hold hearings to explore PGW's privatization, Council members now cite UIL's subsequent deal with Iberdrola as evidence of the company's bad intent.

"When did UIL and Iberdrola begin discussing the possibility of a takeover?" Council President Darrell L. Clarke wrote in letter published in The Inquirer after UIL and Iberdrola announced the merger. "Was its effort to acquire PGW designed to help UIL stave off a takeover by a much larger company, or to increase its asking price?"

In a recent interview, Jim Kenney, the Democratic mayoral candidate and a former councilman, referred to the Iberdrola transaction, saying that he preferred that PGW's profits flow to the city rather than UIL or "the Spanish company that we didn't even know was in the picture at the time."

Iberdrola USA's registration statement, filed with the SEC during the summer, sheds light on details of the transaction that have been the subject of speculation by Council members.

Iberdrola's chief development officer initiated a discussion with UIL's Torgerson on May 20, 2014, about 11 weeks after Torgerson signed the deal with the Nutter administration to buy PGW for $1.9 billion, according to the SEC filing. The city had selected UIL after a protracted sales process that began with more than 30 bidders.

According to a narrative in its SEC filing, Iberdrola indicated that it was interested in a merger "whether or not the PGW transaction was completed."

A wind-turbine manufacturer whose Maine-based U.S. subsidiary owns several Northeast electrical utilities, Iberdrola had long-standing relations with UIL. It sold three New England gas utilities to UIL in 2010, after which executives of the firms stayed in "regular contact" with each other, according to the SEC filing.

UIL, which is based in New Haven, Conn., and owns four utilities, portrayed the contact as routine networking in an industry undergoing much consolidation. It said its senior managers regularly meet with executives of other utilities "to discuss industry trends and possible transactions to enhance shareholder value."

"Conversations happen all the time," UIL's spokesman, Michael A. West, said Thursday.

The company was "110 percent committed to Philadelphia" until the deal collapsed because City Council declined to hold a vote, West said.

Some Council members have suggested that UIL's promises to Philadelphia would have become null and void if UIL were subsequently acquired. But West and Nutter spokesman Mark McDonald said UIL's buyers would have been bound by the sales agreement, which included a promise to freeze rates for three years, as well as employee protections and adoption of all of PGW's environmental liabilities.

"The terms, conditions, and commitments we agreed to were absolutely legally binding," West said.

Under the PGW sales agreement, UIL had the option to pull out after July 15, 2014, if City Council did not approve the sale. Torgerson, at Nutter's urging, continued to pursue the sale after the deadline passed.

On Oct. 27, Clarke announced that Council would not hold hearings on the PGW sale because there was no support for the administration's proposal.

Although UIL still maintained a public posture that it was pursuing the PGW sale, its attention privately began to turn to Iberdrola.

On Oct. 28, Torgerson told the UIL board that Iberdrola was "seriously interested" in a merger and that the board "should begin to consider whether this was something it would wish to pursue following the completion or termination of the PGW transaction."

On Nov. 20, UIL and Iberdrola signed a nondisclosure agreement allowing for the sharing of confidential information. The agreement included a standstill provision - a commonly used defense against a hostile takeover - that prohibited Iberdrola from bidding for UIL except in connection with a mutually negotiated transaction.

On Dec. 2, UIL and Iberdrola executives and their legal advisers met in New York to discuss the structure of a potential merger. A price was not discussed, according to the filing.

On Dec. 4, UIL announced it was formally terminating the PGW sale agreement.

With the PGW deal off the table, talks between UIL and Iberdrola accelerated. On Feb. 25, the companies announced Iberdrola USA would acquire UIL for $3 billion including assumption of UIL's debt. Though UIL is the smaller partner, Torgerson would head the combined U.S. operation.

In June, the Connecticut Public Utilities Regulatory Authority issued a draft decision indicating that it would reject the merger because it would "weaken" UIL's Connecticut utilities.

Last month, UIL's utilities negotiated an agreement with the state consumer advocate committing themselves to a package of customer benefits. UIL also agreed to a $30 million environmental cleanup of a New Haven power plant it sold to private buyers in 2000.

Connecticut utility regulators have not yet voted on the revised UIL-Iberdrola merger application.

UIL's West said the company's experience navigating the Connecticut regulatory sphere contrasted with its reception in Philadelphia.

"The main difference here between the process in Philadelphia is that the democratic process was allowed to continue," he said.

215-854-2947@maykuth