U.S. automaker Chrysler will become fully owned by Italy's Fiat under terms of an agreement announced Wednesday that also involves the United Auto Workers union.

The agreement comes more than 4-1/2 years after the Obama administration brought Fiat in to keep Chrysler in business as part of a packaged bankruptcy proceeding.

In a statement, Fiat said it has agreed to pay $3.65 billion for the 41.46% of Chrysler it doesn't already own from the UAW's medical benefits trust for retirees.

Fiat shares gained nearly 13% in Milan early Thursday to trade at €6.70, their highest level since July 2011.

In addition to the deal, Chrysler will contribute $700 million to the benefits trust over a 4-year period. For its part, the UAW has agreed to support the automaker's plans to roll out vehicles and will drop a Delaware court proceeding over options exercised by Fiat in the acquisition of Chrysler.

Related: 2013: The year in cars

"The unified ownership structure will now allow us to fully execute our vision of creating a global automaker that is truly unique in terms of mix of experience, perspective and know-how, a solid and open organization that will ensure all employees a challenging and rewarding environment," said Sergio Marchionne, CEO of both Fiat and Chrysler.

The full takeover of Chrysler by Fiat means it will not have to go ahead with plans for an initial public offering of Chrysler stock, which had been set to take place in the first three months of 2014.

Fiat had filed to offer the shares held by the UAW trust if it hadn't been able to reach a deal to repurchase the shares.

Chrysler has enjoyed great success under Fiat's ownership. It returned to profitability in 2011 and has been steadily improving sales and market share. Final 2013 sales figures are expected to show the company sold 2.6 million vehicles worldwide, up about 18% from 2012 and more than 70% from 2010, its first full year under Fiat's control.

The U.S. government also held a stake in Chrysler at the time it emerged from bankruptcy as compensation for the federal bailout the automaker received. But Treasury sold those shares back to Chrysler at a loss in 2011.

--CNNMoney's Chris Isidore contributed to this story