Tesla reported Wednesday its loss for the second quarter widened to $184 million as the electric carmaker geared up for expansion.

The tripled from the $61 million in the same period a year ago for the company founded by tech entrepreneur Elon Musk and known for producing vehicles sought after by celebrities and other wealthy individuals.

Revenue rose some 20 percent from a year ago as Tesla produced a record 12,807 vehicles and delivered 11,532.

Tesla has been in the midst of a global expansion, and is preparing to launch its new Model X, a crossover designed to boost the market appeal for the company.

"We are now targeting deliveries of between 50,000 and 55,000 Model S and Model X cars in 2015," Musk said in a letter to shareholders with his chief financial officer Deepak Ahuja.

"We are still testing the ability of many suppliers to deliver high quality production parts in quantities sufficient to meet our planned production ramp."

Tesla plans to invest about $1.5 billion this year to expand production capacity, construct its huge "Gigafactory" for batteries and expand its network of charging stations

Tesla is also gearing for a new project to adapt to store power in homes and businesses.

While Tesla produces relatively few vehicles, it has become a star in the sector due to keen demand and a reputation for high quality.