The Mozdok–Makhachkala–Kazi Magomed pipeline is a natural gas pipeline from Mozdok in North Ossetia through Chechnya and Dagestan to Azerbaijan. The Azerbaijani section is also known as the Kazi Magomed–Novo Filya or Baku–Novo Filya, and it connects Baku with the Novo Filya gas metering utility on the Russian side of the Azerbaijan-Russia border. The pipeline will be used for transportation of Azerbaijani gas to Russia starting from 1 January 2010.
In 1970–1979, Southern Caucasus republics of the Soviet Union were supplied by natural gas from Iran. After Iranian Revolution Iranian supplies were cut off. To replace Iranian gas supplies from Western Siberia and Orenburg through Novopskov were planned. For this purpose, the North Caucasus–Moscow line was reversed and expanded further south by construction of the Mozdok–Makhachkala–Kazi Magomed and Mozdok–Tbilisi–Kazi Magomed pipelines. The Mozdok–Makhachkala–Kazi Magomed pipeline was completed in 1983.
In 2007, Azerbaijan started its own gas production and the pipeline between Russia and Azerbaijan became largely inactive. In the summer of 2008, Gasprom started negotiations with State Oil Company of Azerbaijan on buying natural gas from Azerbaijan at market prices based on long term agreement between two countries. It had been announced earlier that Russia was willing to diversify its imports and purchase natural gas from Azerbaijan's Shah Deniz gas field.
On 29 June 2009, during an official visit of the Russian President Dmitry Medvedev to Azerbaijan, governments of both countries signed a deal on exports of Azerbaijani gas to Russia. As per agreement, Russia would be paying Azerbaijan $350 per thousand cubic meters while paying only $300 per thousand cubic meters for Uzbek and Turkmen gas. Under the terms of the deal, Azerbaijan is to sell Russia 0.5 billion cubic meters annually with a possibility of increase of the volume to 1.5 in the future. On 14 October 2009, President of State Oil Company of Azerbaijan, Rovnag Abdullayev and CEO of Gasprom, Alexei Miller, finalized the deal. The agreement oversees the exports for 2010-2014 with a potential for extension. Azerbaijani natural gas would be transported via the Baku-Novo Filya pipeline, which was previously used for transporting of natural gas from Russian to Azerbaijan, until 2007, when the shipments were stopped by Azerbaijan as a result of internal self-sufficient production. On January 21, during the meeting between Alexey Miller and Rovnag Abdullayev Gasprom expressed its willingness to purchase more gas from Azerbaijan. The parties agreed to double the amount of gas to be transport during 2010 from initially planned 500 million cm to 1 billion cm and yet increase the amount to 2 billion cm in 2011. Starting from 2007, Azerbaijan became exporter of natural gas by starting its shipments to Georgia and Turkey.
The overall length of the pipeline is 680 kilometres (420 mi), of which 200 kilometres (120 mi) in Azerbaijan. The pipe diameter is 1,220 millimetres (48 in) and it had original capacity of 13 billion cubic meters of natural gas per year. The operating capacity is around 5 bcm. It has a gas metering station in Şirvanovka, built in 2003. In Mozdok, the pipeline is connected with North Caucasus–Moscow line.
Experts argue that the significance of the deal is high both for Azerbaijan and Russia. Russia will be paying Azerbaijan an estimated $350 per thousand cubic meters which is the highest price Russia had ever paid for gas imports from Caucasus and Central Asia (compare to $300 per tcm for Uzbek and Turkmen gas), thus hoping to decrease prospects of other potential gas export projects from or through Azerbaijan such as Nabucco or White Stream. Controlling flows of natural gas to Europe is at the forefront of Russian foreign policy and whether the gas exported to Europe is produced in Russia or is coming from elsewhere through Russia, Russia likes to keep an economic control over Europe thus exerting political pressure on the continent and the West as whole through vital energy exports. Russia's production of natural gas in 2008 equalled to 602 billion cubic meters and 154 bcm of it was exported to Europe and Turkey. A much smaller amount of gas to be received from Azerbaijan at higher prices through the Baku-Novo Filya pipeline and the notion that Russia is charging European importers $280 per thousand cubic meters (much lower than it's willing to pay Azerbaijan), proves Russia's ambitious long term intentions.
Up to 2007, Azerbaijan was a Russian gas importer until country's production of 10.3 bcm per year brought self-sufficiency for internal demand of 8.3 bcm. Azerbaijan's Shah Deniz field is to produce approximately 9 bcm per year, whilst Shah Deniz II is believed to produce 10-12 bcm per year when it becomes operational.
During the 1990s–2000s, the pipeline was attacked several times in Chechenya and Dagestan. On 12 January 2010, the pipeline was targeted at its 496th kilometer by a bomb blast on the branch line supplying Derbent and surrounding regions in Dagestan, causing fire and leaving 214,000 people without gas supply. Gas supplies from Azerbaijan by the main trunk line continued by reduced volume.