MADISON, Wis. (AP) -

Tesla Motors has settled a lawsuit alleging the company sold a defective electric car to a Wisconsin doctor.

The deal calls for the California-based company to pay Franklin physician Robert Montgomery nearly $127,000 to cover the car's cost, his taxes and his attorney fees.

Montgomery filed the lawsuit in Milwaukee County Circuit Court in April alleging his 2013 SP Sedan was in the shop for more than 30 days with various problems. Attorney Vince Megna, who touts himself as the lemon law king, handled the case for Montgomery.

Court records show the case moved to federal court in May and the two sides reached the settlement deal in June. A judge dismissed the case last week.

Tesla attorney J. Donald Best didn't immediately return telephone and email messages Monday.