(Toyota/Tesla story updated with share price movements and further background on the deal between the carmakers.)

NEW YORK (

TheStreet

) --

Toyota

(TM) - Get Report

has agreed to buy $50 million in common shares in the electric-car startup

Tesla

as the embattled Japanese automaker seeks to gain a competitive edge in the green-car market.

Toyota said it wants to bring all-electric vehicles to market by 2012 and believes that California-based Tesla will contribute to this plan. Unlike Toyota's once-blockbuster Prius hybrid, Tesla's cars are zero-emission, all-electric vehicles.

Toyota is purchasing the Tesla stake in a private offering set to close just ahead of Tesla's planned initial public offering, which was announced in January. Tesla's former chief marketing officer, Darryl Siry,

wrote on his blog

earlier this month that, according to "chatter the chatter I hear about the offering," Tesla's IPO could be priced at $10 to $12, raising $1 billion to $1.5 billion for the upstart Los Angeles-based carmaker.

That would represent "just a 10-15% premium over their last round of financing," Siry wrote in his blog posting. "Certain insiders at Tesla are no doubt looking for a higher valuation, but the risk they run in pushing too high on valuation is that the stock will move down shortly after going public which would be a bad situation."

According to

Bloomberg

, proceeds from Tesla's private sale, which the company hopes will bring in $100 million, would likely pay for factory and equipment expenses -- which could add up to $125 million this year -- and acquisitions.

As for Toyota, its electric-car moves offered a brief distraction from the company's continued legal and recall woes as it strives to fix ubiquitous gas-pedal defects in its vehicles.

On Friday, it initiated yet another recall -- this time of more than 4,500 Lexus LS luxury cars in Japan -- due to a computer defect that's been linked to problems in steering systems. A similar recall is expected in the U.S.

Tesla has also been supplying German automaker

Daimler

( DAI) with battery packs for a group of small electric cars now in the testing phase.

Last May, Daimler invested about $50 million in Tesla, as well. Daimlier's interest in Tesla was reduced to roughly 5% after the German automaker sold Tesla shares to

its

biggest investor, Aabar Investments PJSC.

Some of Toyota's biggest competitors in the U.S. "green" car market include

Nissan

(NSANY)

and

GM

.

Shares of Toyota were adding 1.3% to $74.99 Friday.

Elsewhere among automakers, Nissan's stock inched lower by 0.5% to $14.93, while Daimler was gaining 1.2% to $48.33.

-- Reported by Andrea Tse in New York

Copyright 2010 TheStreet.com Inc. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.