ISTANBUL—Russian President Vladimir Putin said Moscow will stop pursuing Gazprom’s South Stream pipeline project that would supply natural gas to Europe with an underwater link to Bulgaria, blaming the European Union for scuttling the project.

The announcement came after a day of meetings with Turkish President Recep Tayyip Erdogan in Ankara. The two leaders said in a news conference that Russia and Turkey had reached a preliminary agreement to start work on an alternative pipeline to Turkey that would terminate at a gas-distribution...