Insurance giant AIG is trying to seize a $490 million charitable endowment — and claw back $27 million it already awarded to New York charities — to pay executive bonuses, The Post has learned.

The endowment, called Starr International Foundation, is run by former AIG chairman Hank Greenberg, and has given millions to the Sept. 11 Memorial and Museum, Citymeals and other local groups.

At issue is a legal conundrum that started in the 1970s, when Greenberg was building AIG into the world’s largest insurance empire, and wanted a way to reward his executives off the books.

He and several co-founders set up their own offshore piggy bank — unaffiliated with AIG ownership — and seeded it with their own stock shares that would pay dividends and build up nest eggs and bonuses for retiring executives.

The separate company, Starr International Co., worked well for decades. But in 2005, Greenberg was pushed out of AIG in a boardroom coup, foreshadowing AIG’s collapse.

Greenberg closed his piggy bank for any future bonuses beyond 2005, though AIG executives who had vested by that point can collect when they turn 65.

The rest of the AIG shares held by Starr International Co. — about 290 million — were transferred to a charitable subsidiary, Starr International Foundation.

AIG said it’s entitled to the whole pot of stock going back to 2005, when it was worth about $20 billion. A year ago, it was worth nearly $11 billion, until AIG’s recent collapse. At Friday’s close, the shares were worth $490 million.

AIG says it has the right to seize the stock because Greenberg set up the company specifically for company employees. The insurer says in a legal filing that it needs the foundation’s money “for the exclusive purpose of being distributed to AIG employees in the future.” AIG intends to go to trial in federal court June 15.

AIG lawyers said in documents it would seek not just the shares still left in the foundation’s coffers, but the shares the foundation already cashed out in the past three years to raise $27 million in grant money. That money went to groups like the Sept. 11 Museum ($1 million), Seedco ($500,000) and Citymeals ($250,000).

AIG didn’t return calls by The Post about how the seizure and potential clawbacks of assets would impact charities. Greenberg declined to comment.

AIG has stuck by its previous statement that it needs the charity’s assets “so the company can attract and retain top employees to manage the business, preserve and restore stockholder value and ultimately repay taxpayers.”

Legal experts say that if AIG wins its case, it would have the right to sue to claw back some of the $27 million already awarded to charities.

The government owns nearly 80 percent of AIG due to the Treasury’s $70 billion cash infusion and loans for up to $85 billion.

Rep. Brad Sherman (D-Calif.), who has often grilled AIG in congressional probes, said that if AIG wins the money from the foundations and other charities, “it should go to taxpayers, not for bonuses.”

paul.tharp@nypost.com