TOKYO — Sony said on Thursday that it had eked out an annual profit for the first time in five years, thanks to belt-tightening and the weakening yen. But the company’s future continued to hinge on turning around its unprofitable electronics business.

The Tokyo-based electronics and entertainment giant said that it had booked a net profit of 43 billion yen, or $435 million, in the financial year that ended March 31. That compares with a loss of 456.7 yen billion ($4.6 billion) a year earlier. Sales grew 4.7 percent to 6.8 trillion yen ($68.4 billion).

Sony said it expected net profit to increase 16 percent in the current year to 50 billion yen ($505 million). It projected that sales would rise 10 percent this year to 7.5 trillion yen after the company releases a new video game console, the PlayStation 4, during the holiday season and bolsters its smartphone offerings.

The weaker yen, which makes Japanese products more price-competitive in foreign markets, was especially pronounced in the fourth quarter, from January through March. Sony said net profit was 93.9 billion yen ($949 million), compared with a net loss of 255.2 billion yen ($2.6 billion) in the same quarter a year earlier.