The state of Wisconsin has defaulted on an agreement to buy two sets of passenger rail cars from a Spanish manufacturer that has a factory in Milwaukee, according to a lawsuit the rail car maker filed on Friday.

Talgo, which contracted with the state in 2009 to build the rail cars for $4.6 million, said that under the purchase contract the state is responsible for the cost of pre-sale testing of the rail cars and not Talgo, according to the lawsuit, filed in Dane County Circuit Court.

Because of the dispute the train cars have not been tested and Talgo has not been paid for them, so the state is in default on its purchase agreement, the lawsuit states.

According to a news release from Talgo, the cars were to be used on Amtrak's Hiawatha line between Milwaukee and Chicago.

The company said that if the court rules in Talgo's favor the state will have no further rights under the contract and will lose nearly $50 million that it has already spent on the project.

Talgo CEO Antonio Perez said in a statement that the company invested in Wisconsin and created manufacturing jobs but the state has instead decided to breach its contract with Talgo.

"I don't see how any company in the future would choose to do business with the state of Wisconsin when the state has shown that it cannot be trusted to honor contracts that it has signed," Perez said.

The lawsuit names Gov. Scott Walker and transportation secretary Mark Gottlieb as defendants. Walker spokesman Cullen Werwie declined comment, deferring to the state Department of Transportation.

DOT spokeswoman Peg Schmidt declined to comment on the specifics of the lawsuit, but said the department participated in a formal mediation process with Talgo last week to resolve the dispute.

"We are disappointed that the process was not successful," she said.

She said Talgo has failed to complete or test the rail cars and said that they don't meet even basic federal standards, such as those required under the Americans with Disabilities Act.

In a letter to the state DOT last week, Talgo notified the state that the purchase agreement has been terminated and that the company will keep the rail cars.

The lawsuit seeks a judgment finding the state in default on its purchase contract and says that it was properly terminated by Talgo.