Tesla Motors announced Thursday it will use a $50 million investment from Toyota Corp. to help it buy the recently closed Nummi auto plant in Fremont and reopen it to build electric cars.

The project will bring badly needed jobs to the Bay Area and is a surprising win for the Bay Area's green economy just seven weeks after New United Motor Manufacturing Inc. laid off 4,700 unionized auto workers as its two owners, General Motors and Toyota, ended their 25-year partnership at California's last auto plant.

"Thank you for bringing this business to our state," Gov. Arnold Schwarzenegger said as Akio Toyoda, president of the Japanese automaker, joined Tesla chief Elon Musk at Tesla's headquarters in Palo Alto.

The plant's third incarnation - GM opened the factory in 1963 and closed it in 1982 before reviving the plant with Toyota in 1984 - helps anchor the green tech industry taking root around the region that includes solar manufacturer Solyndra and chip-based light maker Bridgelux.

Musk, who made a fortune as a co-founder of PayPal, said Tesla would initially occupy just "a little corner" of the massive factory to make 20,000 electric vehicles per year. That compares with the 500,000 or so gas-powered cars previously built at the plant.

Price not revealed

Tesla will use it to build the planned Model S, a $50,000 sedan that should enter production in mid-2012. Musk and Toyoda did not disclose the plant's sale price.

Musk said Tesla is adding staff at the rate of about 50 persons a month and already hiring former Nummi workers. It expects to have up to 1,000 people in Fremont within the next few years, in addition to roughly 400 people already in Palo Alto.

In an interview with The Chronicle, Musk said the new alliance would produce a joint Toyota-Tesla car that would be a Toyota vehicle powered by a Tesla drive-train, hitting the market before the Model S. The companies also plan to develop other electric vehicles together, he said.

Asked about his posture toward the United Auto Workers, which had represented Nummi's rank-and-file, Musk said, "on the question of the union we're neutral," adding that Tesla would neither encourage nor oppose workers organizing.

"We're thrilled," said Sergio Santos, president of UAW Local 2244, which had fought to keep Toyota in Fremont before it ceased production of gas-powered cars there April 1. "It's going to put some people back to work and bring a lot of jobs to California."

Change in emotion

State and local officials, who had crafted tax incentives, including worker training provisions and an exemption from sales taxes for new factory equipment to preserve Nummi, were as happy about Thursday's announcement as they had been crestfallen seven weeks ago.

In 2009, the federal government awarded Tesla $465 million in loans, most of it to be used opening the Model S facility.

"Once again, Nummi, like a cat, proves it has nine lives," said Alameda County Supervisor Keith Carson.

The move will help Toyota burnish its image, badly dented by recent recalls and safety concerns.

"This way, they're the good guys, keeping the plant open," said Jeremy Anwyl, chief executive officer of the Edmunds.com auto information Web site. "There's a lot of benefits for Toyota in this."

It could also further public acceptance of electric cars after years of false starts. Nissan has already started advertising its all-electric Leaf, while GM will soon introduce the Chevy Volt, a plug-in hybrid.

"Absolutely, it brings electric cars a little closer to the mainstream," Anwyl said of the Toyota-Tesla deal.

The deal was a blow to the Los Angeles County city of Downey, which had spent months wooing Tesla to locate its Model S plant there. But Musk said Thursday that Downey officials knew he had been considering Nummi.

The deal came together so quickly and quietly that members of the Fremont City Council showed up at the news conference only after hearing rumors of the deal and wanted to thank Musk for bringing Tesla to town.

"I don't care if they didn't talk to us, this is a very good surprise," said Fremont City Councilwoman Anu Natarajan.

Personal relationship

But the real secret behind the deal appears to have been the personal relationship struck between Toyoda, 54, and Musk, 38, after the Japanese businessman quietly visited the California entrepreneur about six weeks ago at his home in Southern California.

Toyoda, who had worked at Nummi in the early days of the joint venture with GM, said Thursday that he "learned much about working in America (there) so I feel a personal attachment to the plant."

As Musk told it, the two men spent a day talking and driving around the Los Angeles area in a Tesla Roadster, where, as Toyoda said, "Simply put, I felt the wind, the wind of the future."

The result was a whirlwind deal, with many details still private, to put Toyota's mass manufacturing muscle behind Tesla's design, marketing and technical expertise, to help the money-losing California carmaker - which is in the midst of putting together an initial public offering on Wall Street worth up to $100 million - cement its position as the leader in a nascent market for electric cars.

"He really sees value in understanding how a fast-moving Silicon Valley startup operates," Musk said of Toyoda, adding: "He's sort of looking at this and saying, 'We need to go back and remember what it's like to be a startup.' "

Chronicle columnist Andrew S. Ross contributed to this report.