Whether a startup electric carmaker such as Tesla Motors can make a profit has always been a big question.

The six-year-old company said Friday that, indeed, it was able to generate a profit of $1 million on $20 million in sales in July. Better gross margin from its Roadster 2 line contributed largely to the financial results, the company said.

Tesla executives had previously discussed when they believed the company would achieve profitability, but they were mostly speaking about specific divisions within the company.

Diarmuid O'Connell, vice president of business development at Tesla, said during an interview in March that the Roadster business should become profitable by the third quarter of this year (see Can Tesla Impress the Masses?).

Last October, CEO Elon Musk said the company's powertrain business was already profitable. Musk also mentioned briefly in a newsletter in February this year that the company would be "profitable by mid year."

The company has been designing powertrains not only for its vehicles, but for others as well. The only announced outside customer so far is Daimler, which plans to use Tesla's battery back, charger and software for up to 1,000 Smart electric cars.

Friday's announcement referred to overall profitability of the company during July, which saw a record delivery of 109 Roadsters, the San Carlos, Calif.-based company said.

Whether the company could continue to improve its sales and profit remains to be seen. The company is devoting lots of resources to bring out its second line of cars, the Model S, which is a four-door sedan that Tesla hopes will attract a broader range of buyers.

Unlike the sporty Roadster, which has a starting price of $101,500, the Model S is priced at $57,400. Its standard battery pack would allow 160 miles per charge, and consumers could upgrade the battery packs that could go 230 miles and 300 miles. The company hasn't disclosed the prices for the upgrades.

To bring Model S to the market by the planned launch in 2011, Tesla will have to start building an assembly plant for making the car. It also is set to build a powertrain factory as well.

The company recently won a $365 million federal loan for the Model S plant and another $100 million for the powertrain factory. Musk said previously that the company would build Model S in Southern California. No word yet on the location for the Model S or powertrain factory.

Tesla also lined up Daimler as an investor. In May, the German carmaker said it would take a near 10 percent stake in Tesla. 

Image of the Model S, courtesy Tesla Motors.