Why Panasonic's president Kazuhiro Tsuga admires Elon Musk
Panasonic Corp.’s President Kazuhiro Tsuga poses in front of company logos after an interview with press in Tokyo. Kazuhiro Tsuga, president of Panasonic Corp., speaks at a news conference in Tokyo, Japan. Tsuga says Panasonic has enough resources to improve earnings.

President Kazuhiro Tsuga explains how he pulled the company back from the brink and set it on a path to profitability.

Panasonic (PCRFY) would have gone bankrupt if not for the “emergency” measures taken by Kazuhiro Tsuga. In an exclusive interview with Fortune at this year’s Consumer Electronics Show in Las Vegas, Tsuga, who has transformed the electronics giant since becoming its president in June 2012, said radical steps were needed to save one of Japan’s largest corporate employers.

At the time, Panasonic was in big trouble. It had racked up a staggering loss of $10.2 billion for the fiscal year after pursuing a failed strategy that emphasized its consumer electronics business, which included televisions and mobile phones, at a time when competition was rapidly eroding profits. Panasonic needed “to stop the loss-making quickly,” says Tsuga. “We had to change from just being a consumer-electronics-based company to something else.”

So Tsuga abandoned products, shuttered plants, and outsourced manufacturing. He consolidated Panasonic’s sprawling operations, which included 579 separate subsidiaries, into five divisional companies focused on three strategic regions. He vowed to improve—or exit—all businesses that fail to make at least a 5% profit.

He also cut costs in ways large and small that are more typical of an American takeover artist than a lifer at a tradition-bound Japanese conglomerate. Tsuga suspended Panasonic’s quarterly dividend, paid out since 1950; cut managers’ winter bonuses by 35%; imposed across-the-board pay cuts; stripped 35 top executives of their company cars and drivers (he still has his own); and cut off funding for Panasonic’s popular corporate-sponsored badminton and basketball teams. He also shrank the staff at the company’s headquarters in Osaka from 7,000 to 130 and cut Panasonic’s total employee headcount (330,762 when he took over) by 68,000.

Meanwhile Tsuga aggressively expanded Panasonic’s efforts in business-to-business enterprises, such as automotive electronics, “green” housing construction in Asia, and the manufacture of electric-car batteries through a high-profile partnership with Elon Musk’s Tesla Motors.

“We are too conservative. We are a 95-year-old company,” he says. “We have to change. We have to use some of Elon’s thinking.”

The results have been dramatic. Panasonic returned to profitability in fiscal 2014 and reinstated its dividend. Long known in the U.S. as a TV maker, it now generates just 23% of its global sales (and only 15% of its North American business) from consumer electronics. It’s currently on the hunt for strategic acquisitions to reach its goal of growing revenues to 10 trillion yen by 2018. (Fiscal 2015 revenues are projected at 7.75 trillion yen.) Since Tsuga took over, the company’s stock price has more than doubled.

Tsuga says the company’s 2012 crisis was a chance to force change at a company where it might otherwise have been impossible. Aggressive actions signaled that Panasonic—founded in 1918 and long known in Japan as Matsushita—was “in a very urgent” and “very terrible” situation, he says. “We had to change—
recreate Panasonic. From that point of view, it was a good opportunity.”

Tsuga—an admitted car buff who speaks nostalgically about the 1965 Ford Mustang he drove while studying at the University of California at Santa Barbara in the mid-1980s—is especially enthusiastic about his partnership with Tesla.

In July, Panasonic signed a partnership with the electric-car maker to help build and operate a massive lithium-ion battery “gigafactory”—so big that it will double current worldwide cell production. The project is aimed at cutting battery costs for Tesla’s (TSLA) promised mass-market electric car, helping reduce its sticker price to $35,000. The $5 billion facility is now under construction in the Nevada desert outside Reno. CEO Musk’s audacious goal: to sell 500,000 electric cars (more than 10 times Tesla’s current production) by 2020.

Musk has publicly said that he expects his battery partner to provide about 40% of the giga-factory’s total cost, which would be $2 billion. Tsuga says he has committed no 10-figure check, and that Panasonic plans to invest in eight stages, starting with an initial tranche of $300 million. The total (and timing) is subject to change, says Tsuga: “If the demand for Tesla cars becomes less than their expectation, we simply have to slow down our investment, that’s all.”

But Tsuga believes there is opportunity to build batteries for stationary energy storage for solar panels as well as cars, and to increase Panasonic’s share of electronic car components. “For us, if the EV market grows rapidly, it will be totally good for business in various senses,” he says. “So we asked ourselves, Who is most seriously thinking about EVs? Tesla. That’s why we are working so closely with them.”

Besides, the chance that some of Musk’s moon-shot magic will wear off on stodgy Panasonic can’t hurt.

“Great guy!” Tsuga says. “Even though he knows the difficulties, he can think quite optimistically. That’s why I love to work together with him.”

This story is from the March 15, 2015 issue of Fortune.