American International Group's (NYSE:AIG) protracted effort to sell off its International Lease Finance Corp. division looks to be nearing a close. After four years of peddling the aircraft-leasing division's benefits, the insurer has finally landed a buyer: AerCap Holdings (NYSE:AER).

A long time coming
Investors following the story of AIG's attempts to sell ILFC will be familiar with the timeline. Ever since the company's near-collapse in 2008, ILFC had been deemed as a noncore asset and marked for sale. Most buyers balked at the high sale price, among other concerns, and AIG was left holding the bag. But in December 2012, the insurer struck a deal with a group of buyers that looked promising.

The insurer had been cooperating with a Chinese consortium for nearly a year, without a clear end in sight. The deal would have given the consortium 80% of the ILFC operations for $4.2 billion, with an option to buy an additional stake later. But when deadlines were missed and new investors needed, the consortium looked less capable of closing the deal.

The third-quarter earnings conference call this year marked a turning point for AIG. Analysts and other listeners noted a sense of urgency by management to resolve the ILFC sale. Finally, the company would be more proactive in seeking either a new buyer or pursuing an IPO.

Enter AerCap
AIG had been in talks with AerCap, an aircraft leasing company based in the Netherlands. AerCap was owned by DaimlerChrysler before being sold to a group of private equity firms. In 2010, the firms sold their share of AerCap to Waha Capital, which now owns a 26% stake in AerCap.

Though AerCap is today considered a small player in the aircraft leasing market, it is known for the purchase and sale of older planes. This is a healthy match for ILFC, which owns a large number of jets with an average age of eight years. Over the past four years, ILFC has taken $4.7 billion in writedowns over the value of its inventory. The company has ordered a number of new jets to help keep pace with the higher demand for leased aircraft.

With the combined fleet of AerCap and ILFC, the new operation will rival the world's largest leaser, General Electric's (NYSE:GE) GE Capital Aviation Services, which boasts almost 1,700 planes. The combined fleet sits at 1,300 planes, with a book order of 400 more planes from various manufacturers.

The terms
The deal between AIG and AerCap is valued close to $5 billion, with AIG receiving $3 billion in cash and 97.5 million shares, approximately a 45% stake in AerCap. Set to close during the second quarter of 2014, the deal would allow ILFC to readjust its accounting treatment of its older aircraft so they are written down to current market value -- avoiding the need for AerCap to make the adjustments at a later date, which could hurt its stock performance.

USB and Citigroup (NYSE:C) are slated to provide $2.75 billion in financing for the deal, and AIG will provide AerCap with a $1 billion unsecured, revolving credit facility.

Though the deal still requires regulatory and shareholder approval, AerCap's largest investor, Waha Capital, has already approved the agreement. Since AIG will be AerCap's largest investor after the deal closes, investors can expect to see ILFC's operations in the insurer's reporting of continuing operations going forward.

It's about time
For AIG investors, news of the deal is a welcome relief. The uncertainty hanging hanging around the ILFC sale has been dragging down the company's share price, which jumped 2% this morning following the announcement. AerCap investors should also welcome the deal, as ILFC has consistently provided good earnings and has a large client base. Since AIG has been looking to sell off the aircraft leasing operations for so long, the transaction will allow it to return more capital to shareholders and to pursue new operational priorities.

Fool contributor Jessica Alling has no position in any stocks mentioned. The Motley Fool recommends American International Group. The Motley Fool owns shares of American International Group, Citigroup, and General Electric Company and has the following options: long January 2016 $30 calls on American International Group. Try any of our Foolish newsletter services free for 30 days.

We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.