AOL Inc on Wednesday posted a major quarterly loss in the second quarter due to a goodwill impairment charge related to its sale of social networking site Bebo and a precipitous drop in advertising revenue.

The company warned in a regulatory filing that it expects total revenue and operating income to decline in the near term and foreseeable future as it continues to restructure its advertising business.

Net loss during the quarter was $1.06 billion, or $9.89 a share, compared with a profit of $90.7 million, or 86 cents a share a year ago.

AOL recorded a goodwill impairment charge of $1.4 billion during the quarter following a goodwill impairment charge test. The company's net assets had increased due to a significant deferred tax asset following its sale of Bebo, which had coincided with a decline in its share price.

Revenue fell 26 percent to $584.1 million as advertising declined on all fronts as did its subscription fees.

Advertising revenue declined 27 percent to $260.2 million.

Analysts had on average been expecting revenue to come in around $610 million, according to Thomson Reuters I/B/E/S.

(Reporting by Yinka Adegoke, editing by Maureen Bavdek)