SAN CARLOS, CA --- Two Silicon Valley entrepreneurs -- Martin Eberhard and Elon Musk -- are embroiled in a legal battle over who deserves credit for "founding" Tesla Motors and who was responsible for the mistakes that temporarily threatened Tesla's survival. 

Earlier this decade, the electric vehicle manufacturer was plagued by production delays, management missteps and employee layoffs. But more recently, the automaker has shown signs of promise. Tesla has drawn an investment from Daimler AG and a low-interest loan of $465 million from the U.S. government, the Associated Press reported. 

In a lawsuit filed in San Mateo County Superior Court, Eberhard claims that Musk has libeled and slandered him in media interviews and blogs. Eberhard, who left Tesla in 2007, is also suing to recover a $100,000 severance package the company withheld from him for allegedly violating a non-disparagement agreement. 

Eberhard is asking a judge to prohibit Musk from referring to himself as Tesla's "founder" in press releases, blog postings and other public statements. 

What's more, Eberhard alleges in the lawsuit that Tesla broke its promise to deliver the second produced Tesla Roadster to him. 

Lawyers for Musk and Tesla on July 29 are expected to ask a judge to reject the lawsuit. Musk has said Eberhard's tenure as Tesla's CEO from 2004 to 2007 was disastrous.