Sony Corp. is expecting an annual loss of $3.1 billion, reversing its earlier projection of a return to profit, as the electronics giant struggles with production disruptions from Japan's tsunami and a hacker attack on its online gaming service.

The Japanese maker of PlayStation 3 video game machines and Bravia flat-panel TVs said Monday that the projection of $3.1 billion net loss for the fiscal year ended March 2011 was largely due to writing off $4.2 billion related to a tax credit booked in the fourth quarter.

Sony announced the loss ahead of its official earnings announcement Thursday under Tokyo Stock Exchange guidelines. The company had earlier projected a $840 million profit.

Like many other Japanese manufacturers, Sony has been hampered by the production disruptions set off by the March 11 earthquake and tsunami that killed more than 25,000 people, destroyed many factories and sent the nation's economic recovery into reverse.

Recovery still underway

Masaru Kato, Sony's chief financial officer, said parts shortages in the aftermath of the disaster have eased but a full recovery hasn't yet been realized.

"In the first quarter, we saw quite a major impact on our manufacturing activities," he said. After the quake, "negative factors have grown bigger" and offset earlier improvement in the previously loss-making games division, dashing hopes for a profit.

Tokyo-based Sony also faced a new challenge to its reputation following a massive security breach affecting more than 100 million online accounts.

After temporarily closing down its online gaming services last month, Sony began restoring its PlayStation Network services in the U.S. and Europe on May 15 mainly for online gaming, chat and music streaming services.

Sony spent $160 million to cover costs that included identity theft insurance for customers, improvements to network security, free access to content, customer support and an investigation into the hacking.

Sony has seen plunging sales of flat-panel TVs and other gadgets, and was likely to remain in the red in its TV business for the seventh year straight.

Sony has also taken a beating in music players and other portable devices to Apple's iPod, iPhone and iPad.