AIG and former chief executive Maurice Hank Greenberg have reached an agreement to bury a long-standing, bitter legal battle and the insurer will turn over materials the former boss can use to write his memoir, as well as prized photographs and a Persian carpet.

The settlement is a feather in the cap of AIG Chief Executive Robert Benmosche, as it frees up the company's resources to deal with the more pressing matter of repaying taxpayers, which gave the company a $180 billion bailout to save it from collapse under soured mortgage bets last year.

Greenberg, who built AIG into the world's largest insurer over nearly four decades, had been locked in a costly and complicated legal tussle with the company dating back to his unhappy departure from the firm more than four years ago.

Benmosche, in a statement, said the settlement will remove a significant distraction and expense and allow AIG to better focus its efforts on paying back taxpayers.

CEO since August, Benmosche first reached out to Greenberg when he was considering taking the job, leading the parties to agree to work together to settle their differences.

I look forward to assisting AIG in trying to preserve and restore as much value as possible for all of AIG's stakeholders, said Greenberg, who now runs several private firms after his ouster from the insurer in 2005, amid an investigation by then New York attorney general Eliot Spitzer.

Separately, AIG said it finalized changes for salary and bonus to be paid to Chief Financial Officer David Herzog, and Kristian Moor, CEO of its global property-casualty unit.

Herzog could receive cash and stock of up to $4.5 million, and Moor up to $7.6 million. The executives' compensation was reworked to comply with regulations imposed by Washington pay czar Kenneth Feinberg, who has oversight of pay at firms which got the biggest U.S. bailouts.

Under the deal with Greenberg, he will get back treasured possessions that remained behind at AIG when he departed, including a photograph of himself with company founder Cornelius Vander Starr and a Persian rug that once graced the entrance to the company's boardroom at 70 Pine Street in downtown Manhattan.

American International Group Inc announced details of the settlement in a regulatory filing late on Wednesday, including to release each other from all claims, and a promise not to make disparaging public statements about each other.

AIG said it also agreed to reimburse Greenberg and other parties for reasonable legal expenses up to $150 million.

The pact covers Greenberg, companies he controls, and AIG's former chief financial officer, Howard Smith.

(Reporting by Lilla Zuill; editing by Andre Grenon)