Image caption The $182bn rescue of AIG was the biggest of the 2008 financial crisis

The board of US insurance giant AIG has said that it will not join a $25bn (£16bn) shareholder lawsuit against the US government, which alleges that the terms of its rescue deal were unfair.

AIG came close to collapse at the height of the financial crisis and was bailed out by the government in 2008.

The lawsuit argues the bailout did not properly compensate shareholders.

It was filed by Starr International, headed by former AIG chief executive Maurice "Hank" Greenberg.

Starr had asked the board to join in or take the lead in the lawsuit, and the company had said that it would consider the demand at a board meeting on Wednesday.

But following the meeting AIG said in a statement: "The AIG board has determined to refuse Starr's demand in its entirety, and will neither pursue these claims itself nor permit Starr to pursue them in AIG's name.

"AIG expects to file with the courts a formal statement detailing the Board's determination and the reasons underlying it in the coming weeks."

It added that by considering and ultimately refusing the demand, the board had properly and fully executed its fiduciary and legal obligations to AIG and its shareholders.

The $182bn government rescue of AIG was the largest of the 2008 financial crisis. The company says it has paid back $205bn including a $22.7bn profit.

The prospect of the insurer joining the lawsuit had already sparked anger in the US, particularly given the firm is currently in the middle of a "Thank you America" advertising campaign.