Russia and Greece have signed a deal to build an extension of a prospective gas pipeline that would carry Russian gas to Europe through Turkey.

Russia has promised Greece hundreds of millions of dollars in transit payments yearly if it agreed to build the pipeline.

The deal comes as Greece is at an impasse in talks with its creditors for the additional loans it needs to avoid defaulting on debt payments.

Russian Energy Minister Alexanader Novak said he and his Greek counterpart signed the memorandum Friday during an investment forum in St. Petersburg.

Greek Prime Minister Alexis Tsipras also is in St. Petersburg and will meet with President Vladimir Putin later in the day.

Construction of the Greek pipeline is expected to start next year and be completed in 2019.