American International Group Inc posted a first-quarter profit, reversing a year-earlier loss, as the bailed-out insurer's investment portfolio gained in value.

AIG, nearly 80 percent-owned by the U.S. government, reported a profit to the company of $1.5 billion, or $2.16 per share, compared with a loss to the company of $4.4 billion, or $39.67 a share, in the year-ago quarter.

The insurer reported $16.3 billion in revenue for the quarter.

AIG is trying to repay the government after a $182.3 billion taxpayer-funded rescue at the height of the financial crisis in September 2008.

Earlier this year, it agreed to sell two major foreign life insurance businesses for a total of about $51 billion.

(Reporting by Elinor Comlay; editing by John Wallace)