(Reuters) - Insurer American International Group Inc (>> American International Group Inc) said on Monday it will sell its aircraft-leasing business to AerCap Holdings NV (>> AerCap Holdings N.V.) for $5.4 billion, after four years of trying to divest its biggest non-insurance business in fits and starts.

The insurer, which was nearly wiped out by derivative bets during the financial crisis, put International Lease Finance Corp on the block after receiving a $182 billion government bailout package in 2008. AIG repaid the rest of the money owed to the U.S. Treasury in March, but still wanted sell ILFC as part of its efforts to focus on insurance.

As part of the cash and stock deal, AIG will end up holding a nearly 46 percent stake in AerCap for at least nine months after the deal closes. But the move nevertheless rids AIG's balance sheet of ILFC's debt and aircraft purchase commitments, and allows the insurer to focus on its property-casualty and life insurance operations.

The deal will give AerCap, a Netherlands-based lessor, a fleet of 1,329 aircraft - the second largest after General Electric's (>> General Electric Company) aircraft leasing division GECAS, which owns and services 1,630 aircraft.

The deal will result in annual operational cash flow of $3 billion and savings of about $100 million a year by the end of 2015, AerCap Chief Executive Angus Kelly said in a call with analysts.

AerCap's shares rose more than 35 percent following news of the deal and were up 30.5 percent at $32.53 late Monday afternoon. AIG shares edged up 1 percent to $50.23 on the New York Stock Exchange.

"It's a good transaction for AIG," said Clifford Gallant, an analyst with Nomura Equity Research, a division of Nomura Co Ltd (>> NOMURA Co., Ltd.). "It gets to retain 46 percent, so they get a future earnings stream from the company. ... It simplifies AIG's balance sheet, enabling them to do things like buy back stock or have more capital flexibility."

The deal comes almost exactly a year after AIG announced it was selling a 90 percent stake of ILFC to a group of investors based mainly in China for $4.7 billion. That deal valued ILFC at about $5.3 billion.

But last spring, the consortium was late with a payment for the business, raising concerns about whether the deal would close.

By late summer, AerCap began lining up financing to strike a deal to buy ILFC, according to three people familiar with the situation who are not authorized to speak to the media.

Under the terms of the deal, AIG will get $3 billion in cash and 97.56 million new common shares of AerCap, giving the deal a value of $5.4 billion based on AerCap's closing share price on Friday.

The insurer can begin selling its stake in AerCap in stages over a nine- to 15-month period after the deal closes. The deal is expected to close in the second quarter.

But while AIG will retain a stake in AerCap for some time, the deal enables the insurer to wipe $21 billion in debt associated with the business off its balance sheet. Net cash proceeds to AIG at closing are expected to be around $2.4 billion.

UBS (>> UBS AG) was the financial adviser to AerCap while Goldman Sachs (>> Goldman Sachs Group Inc) was the financial adviser to AerCap's board.

Citigroup (>> Citigroup Inc) was the lead financial adviser to AIG, and Morgan Stanley (>> Morgan Stanley) and JPMorgan Chase & Co (>> JPMorgan Chase & Co.) also advised on the deal, an AIG spokesman said.

(Reporting by Avik Das in Bangalore; Editing by Saumyadeb Chakrabarty and Richard Chang)

By Avik Das and Jessica Toonkel