Over the past few years, Toyota (TM -0.28%) has experienced a couple of major setbacks. In 2011, the devastating Japanese earthquake slowed production for the company, and this year GM (GM 0.01%) took the top-selling automaker title from Toyota. But despite the rough past few years, the Japanese automaker has cut costs, increased sales, and just raised its yearly profit forecasts.

Leaving the past in the rearview mirror
This week, Toyota managed to raise profit forecasts by 2.6% for the year ending in March. Toyota is on the road to more than tripling its profits year over year to $9.8 billion, while both Honda (HMC -0.09%) and Nissan have cut their full-year profit estimates by 20%.

A dispute between China and Japan over islands in the East China Sea has hurt Japanese auto sales, including Toyota's. The company lowered its full-year production estimates for this year from 8.8 million to 8.75 million. Fortunately for Toyota, it was slower to move into China than some of its Japanese competitors. In 2011, Toyota had 12.6% of its global sales coming from China, compared with Honda's 19.38% and Nissan's 26.7%.  

But Toyota's vehicle sales in North America grew by about 45% compared with the same time last year. In its quarterly earnings call, the company attributed part of the North American sales increase to a solid new car market in the region and its new versions of the Camry, Corolla, and RAV4. In Japan, Toyota's deliveries gained 20% in the last quarter. Toyota benefited from government incentives for small-car purchases and high demand for hybrids from Japanese consumers.

Toyota said the large increase in vehicle sales in all regions was partly because last year's production and sales were disrupted by the earthquake.

Toyota's gains aren't only from sales, though. The company has instituted cost-cutting measures, like using the same parts on several different vehicle models. As Fool writer John Rosevear noted, Toyota has saved 160 billion yen, or about $1.99 billion, in cost-cutting measures this quarter.

Pedal to the metal
Toyota was able to scale back its discounts on cars this year and still regain market share. The company reduced incentives for vehicles in the U.S. to $1,899 in the quarter that ended in September, down from $2,368 in the same quarter last year. The Japanese auto manufacturer has sold 7.4 million vehicles worldwide through September, about 455,000 more vehicles than General Motors (GM 0.01%).

Driving forward
Investors sticking it out with this stock should note Toyota's resilience. Edwin Merner, from Atlantis Investment, recently told Bloomberg BusinessWeek: "Unless you think the world economy is going to fall apart, and it might, Toyota should do well over the coming few years and looks very undervalued if you can take a one- to three-year view." A one- to three-year view (and longer) is right up the Foolish investor's alley.

Investors should watch for Toyota's continual cost-cutting manufacturing and for increases in quality measures. With Toyota vehicles still at the top of reliability rankings, and strong consumer demand for high-mileage vehicles (like the Prius), Toyota may be well on its way to being the top dog in sales again soon.