Last fall, a Delta Air Lines executive reached out to U.S. Rep. Patrick Meehan in Washington and made an audacious suggestion:

The airline, facing relentless increases in fuel prices, was looking to buy the recently idled ConocoPhillips refinery in Trainer to manufacture its own jet fuel. No airline had ever attempted such a strategy.

"I thought, this is a real interesting, smart way to address what's going to be a continuing challenge for them," recalled Meehan, a Republican whose district includes the refinery.

He passed the Delta team on to Gov. Corbett, who met the airline officials at his Harrisburg office before Christmas.

"My first reaction was, 'Wow, they're thinking outside the box,' " said C. Alan Walker, Corbett's secretary of community and economic development. "Right away we latched onto it because we saw an eventual win-win for everybody."

Dozens of people - local, state and federal officials, along with labor union leaders - were sworn to secrecy about the talks until Monday, when Delta announced officially it will buy the mothballed refinery in the Delaware River borough. The deal has received worldwide media attention because of the unusual nature of the buyer.

"We're going to have that facility back up and running by Labor Day," Delta Chief Executive Edward H. Bastian said Tuesday at a ceremony attended by about 100 people, staged in a gravel parking lot across from the refinery's rusting distillation towers and empty storage tanks.

Delta will pay $180 million for the refinery, of which $30 million will be covered by economic development grants from the Corbett Administration. The grants require Delta to invest $350 million in capital over five years - including the purchase price - and to employ 400 people.

"We believe it was a tremendous investment," Corbett said. "Delta is matching our investment ten-to-one."

Tuesday's ceremony was a bipartisan celebratory lovefest, with Republicans and Democrats praising each other, and managers praising unionized labor, and everybody lauding the value of cooperation.

"Everyone put their egos aside for the future of this region," Meehan said.

Delta, which will own and operate the refinery through its subsidiary, Monroe Energy L.L.C., already has a tentative agreement in place with the U.S. Steelworkers local, which will be voted on once the transaction is settled.

The Delta deal also is likely to influence Sunoco Inc.'s efforts to market its Philadelphia refinery, which Sunoco says it will shut down on Aug. 1 if it is unsold. State officials declined to comment on whether they have also offered incentives to the Carlyle Group, the private equity group that is negotiating with Sunoco to run the refinery as a joint venture.

Corbett said the Delta deal "demonstrates how the private sector and government can work together." He said the deal "gives us some good momentum going into the sale of the Sunoco facilities."

The state provided more than money. Michael Krancer, Pennsylvania's secretary of environmental protection, also expedited the transfer of several environmental permits for the refinery, including the renewal of a key wastewater discharge permit.

"That really helped Delta to see that the head of DEP was serious about trying to make this thing work," said Walker, the state development chief. "That sent a pretty strong signal that Pennsylvania was serious."

Delta officials said they decided a year ago to shop around for a refinery. The airline spent $11.8 billion on jet fuel in 2011, about 36 percent of its operating expenses, and realized that about $2 billion of the costs are attributable to the "crack spread" - the difference between the cost of crude oil and the price of refined product.

"No airline has ever purchased a refinery in the long history of the airline industry," said Bastian, Delta's chief executive. "However airlines have never paid the level of fuel prices that we are today."

The Trainer refinery, which was built in 1925 by Sinclair Oil, caught Delta's attention because of its proximity to the airline's hub operations in New York City, said chief financial officer Paul Jacobson.

"We came up and looked at the plant," he said. "These physical assets that are here are conveniently disposed to producing a lot of jet fuel, and that's what we were looking for. It became very interesting, very quickly for us."

The Trainer refinery produces about 23,000 barrels of jet fuel a day, but Jacobson said by investing $100 million in new equipment, the plant can be reconfigured to produce more than 50,000 barrels of jet fuel a day - 2.1 million gallons.

"The more we can maximize jet-fuel production, the more it makes sense," said Jacobson. Delta estimates it can trim its fuel costs by 2.6 percent annually - about $300 million.

Delta is partnering with BP and Phillips66, the newly formed refinery and pipeline company spun off from ConocoPhillips, to supply crude oil and to help market the other fuels produced from the plant.

Delta plans to swap the gasoline, diesel and other fuels that make up most of the plant's production for jet fuel produced in other parts of the country.

"What we've bought is a virtual refinery throughout the United States," said Jacobson. Trainer will supply the equivalent of 80 percent of the airline's domestic fuel needs.

Contact Andrew Maykuth at 215-854-2947, @Maykuth on Twitter or amaykuth@phillynews.com.