(Adds detail and comment from companies, paragraphs 3-5)

PARIS/BERLIN, May 17 (Reuters) - Volkswagen has walked away from talks with Renault to jointly develop an affordable electric version of the Twingo car, two sources familiar with the situation said, in a setback for the EU carmakers' efforts to fend off Chinese rivals.

The collapse of negotiations could mean the German carmaker may have to go it alone in developing its own affordable electric vehicle (EV). Renault will continue designing its electric Twingo, scheduled to hit the market in 2026.

Both had hoped that sharing the work would cut costs that represent a key hurdle for European carmakers in the face of cheaper cars from China.

Ampere, Renault's EV operation overseeing the Twingo programme, declined to comment.

A VW spokesperson also declined to comment on the talks between the companies but said that the German carmaker was still studying its options on cheap EVs.

The companies "did not succeed in finding an agreement" after several months of negotiations, one of the sources said.

Another source said that an agreement had been very close, but that VW walked away from the talks and has decided to develop its own car.

The sources declined to be named because the talks are confidential. (Reporting by Gilles Guillaume in Paris and Christina Amann in Berlin; Editing by Josephine Mason, Sharon Singleton and David Goodman)