Still, A.I.G. posted an operating profit that was better than analysts had expected and its stock rose in after-hours trading.

“A.I.G.’s operating profit this quarter shows the power and financial strength of our diverse global franchise,” Robert H. Benmosche, the company’s president and chief executive, said in a statement. “We achieved these operating profits in spite of storm Sandy.”

This was the first financial report for A.I.G. since the government sold the last of its stake in the company last December. A.I.G. became a household name after it received a $182 billion bailout package from the government at the height of the financial crisis in 2008. The company nearly imploded by making huge bets on mortgage investments that later went wrong.

A.I.G. has repaid the government’s bailout money. It underwent a reorganization that cut its size in half as it turned its focus to writing insurance, its core business.

For the three months ended Dec. 31, A.I.G. reported a loss of $4 billion, or $2.68 a share. That compares with net income of $21.5 billion, or $11.31 a share, a year earlier, when A.I.G. benefited from a tax-related accounting gain of $19.2 billion.

A.I.G.’s property casualty segment bore most of damage costs resulting from the storm, which made landfall on Oct. 29, affecting New York, New Jersey, Connecticut and eight other states.

A.I.G., which is based in New York, booked an after-tax loss of $1.3 billion as a result of the storm. That led to a fourth-quarter operating loss of $945 million in its property casualty unit. It recorded operating income of $367 million a year earlier.

A.I.G. latest results included a $4.4 billion loss related to its agreement to sell the International Lease Finance Corporation. The deal reduced A.I.G.’s per-share book value by $2.97.

Operating income for the quarter was $290 million, or 20 cents a share. That was down from $1.5 billion, or 77 cents a share, a year earlier. Analysts, on average, had expected a loss of 7 cents a share, according to FactSet.

A.I.G. shares closed down 29 cents at $37.28. The stock added $1.53, or 4 percent, to $38.81 in after-hours trading. It is up about 6 percent this year.