President Vladimir Putin, who was joined by Hungarian Prime Minister Ferenc Gyurcsany for a signing ceremony at the Kremlin, said the South Stream project was a "joint contribution by Russia and Hungary to Europe's energy security."
The $15 billion pipeline will go through Hungary after crossing Bulgaria and Serbia, and it further undercuts an alternative project -- the Nabucco pipeline, which has been backed by the United States and the European Union as a way to ease Europe's reliance on Russia for energy.
"If the project is implemented, the role and significance of Hungary as an energy supplier to Europe will grow and its own energy security will be guaranteed," Putin told Gyurcsany before the signing.
Gyurcsany told Putin the Russian pipeline was advancing faster than its EU-backed alternative, "You were faster than Nabucco," he said.
The deal also envisaged a major gas-storage facility in Hungary, turning the EU member into a major hub for Russian energy supplies.
The European Union and the United States are strong supporters of the alternative Nabucco pipeline, which would deliver gas from the Caspian region, and potentially Central Asia, westward through Bulgaria, bypassing Russia. The project has been slowed by high costs and uncertainty over sources of supply.
Moscow dealt a heavy blow to Nabucco last fall after reaching a deal with Turkmenistan and Kazakhstan for those countries' Caspian Sea gas supplies to flow through Russia, draining the main potential source for the EU-backed pipeline.
Russia's state-controlled OAO Gazprom gas monopoly has since moved to secure pipeline-related deals with Bulgaria and Serbia in an effort to win over potential Nabucco customers and pre-empt Nabucco in prospective markets.