When Toyota introduced the world’s first hybrid gasoline-electric vehicle in 1997, it made a loss on every Prius it sold. Decades later, booming sales in the category are delivering a much welcome cash boost.

The world’s largest auto manufacturer recently reported annual operating profit of ¥5 trillion ($32 billion), the first time any Japanese company reached that threshold, with an industry-topping margin of 11.9%. Hybrid sales jumped 32% to 3.59 million units, accounting for one out of every three cars Toyota sells.

With the shift to battery-electric vehicles clearly taking much longer than anticipated, consumers are voting for hybrids with their wallets. That gives Toyota, Honda and other carmakers with hybrid lineups an opportunity to gather up cash that can then be reinvested in the long transition to fully-electric cars.