American International Group Inc reported a quarterly loss on Friday after a year-ago profit as the bailed-out insurer was hurt by a large goodwill impairment charge.

AIG, nearly 80 percent-owned by the U.S. government, reported a second-quarter net loss to the company of $2.7 billion, or $3.96 per share, compared with a net profit of $1.8 billion, or $2.30 per share, a year earlier.

The loss was primarily due to a $3.3 billion non-cash goodwill impairment charge.

AIG reported an adjusted profit of $1.3 billion, or $1.99 per share, up from $1.1 billion, or $1.71 per share, a year earlier.

Once the world's largest insurer, AIG nearly collapsed in September 2008 from credit default swaps that left it on the hook for tens of billions of dollars in payouts to some of the biggest U.S. and European banks.

It was rescued by the U.S. government, which committed $182.3 billion to keep the insurer afloat.

AIG shares rose 5.3 percent in premarket trading. The shares are up 33 percent this year, outperforming the S&P Insurance Index <.GSPINSC>, which is up 7 percent.

(Reporting by Paritosh Bansal; editing by John Wallace)