Photo/Illutration People walk past the logo of Toyota at a showroom in Tokyo, Oct. 18, 2021. (AP Photo)

Toyota’s profit declined 31 percent in the January-March quarter from the year before, but the Japanese automaker still wrapped up a year of record earnings.

Toyota Motor Corp. reported Wednesday a profit of 533.8 billion yen ($4.1 billion) in the last quarter, down from 777.1 billion yen the previous fiscal year. Quarterly sales rose nearly 6 percent to 8.1 trillion yen ($62 billion).

Toyota and other automakers have been struggling to keep up with customer demand for their products because of parts shortages caused by the coronavirus pandemic.

The company still sold 8.2 million vehicles around the world during the fiscal year through March, up from 7.6 million vehicles in the previous fiscal year.

For the fiscal year, Toyota racked up a 2.85 trillion yen ($21.9 billion) profit, up nearly 27 percent from 2.25 trillion yen the year before.

Toyota, which makes the Prius hybrid, Lexus luxury models and Camry sedan, said its profits got a boost from a favorable exchange rate. A weaker yen helps lift the performance of Japanese exporters like Toyota when overseas earnings are converted into yen.

Toyota’s operating income increased across global markets, including Japan, North America, Europe and the rest of Asia. The company said it is expecting vehicle sales to grow in all regions in coming months. It also plans to boost electric vehicle sales, as customers show more interest in ecological vehicles and sustainability goals.

For the fiscal year through March 2023, Toyota forecast a profit of 2.26 trillion yen ($17 billion), 20 percent lower than the fiscal year that ended in March. It expects soaring materials costs to cut into its profits.

Toyota, based in Toyota city, central Japan, warned the various effects of COVID-19 have hurt its operations and added to uncertainty over what lays ahead.