Madrid - Spain has reached an agreement with Portugal and France to substitute plans for a gas pipeline known as Midcat with a new "green corridor" between Barcelona and Marseille that would carry natural gas and hydrogen, Spain's PM Pedro Sanchez said on Thursday.

The new connection between Spain and its neighbour France will be underwater, as opposed to the Midcat project in the Pyrenees, according to a graphic sent by the Spanish Energy Ministry.

Energy Minister Teresa Ribera said it was a "magnificent decision that deepens solidarity and commitment to renewables".

The green corridor would connect Barcelona and the Marseille area, which is a large petrochemical hub.

Sanchez added that the leaders of the three countries will meet again shortly to discuss the timeline, investment required, and how much each country would contribute.

(Reporting by Emma Pinedo, Inti Landauro and David Latona, editing by Andrei Khalip)