Tough sanctions imposed on Russia by Europe and the United States will damage the ability of Russian banks and energy companies to raise capital and buy technology. But Russian oil and gas will still flow into Europe. That’s because Vladimir Putin has spent years turning the country into an energy powerhouse, what Sen. John McCain called, “a gas station masquerading as a country.”

Russia provides Europe with roughly one-third of its oil and about 30% of its natural gas through state-controlled energy companies, such as Gazprom and Rosneft. Oil is priced globally, but Russia commands high prices for its natural gas due to its control of the market. In 2012, Americans paid 3.2 cents per kilowatt-hour for natural gas, while Germans paid 9 cents.

Russia’s economy is highly dependent on its hydrocarbons — more than 50% of its federal government revenues derive from its energy sector. The country’s overall economy is smaller than that of the U.K. or Brazil, yet President Vladimir Putin has shrewdly made use of the nation’s oil sector to punch above his weight diplomatically and militarily.

Now that American and EU sanctions are beginning to pinch and Russia has announced retaliatory sanctions of its own, Putin is facing a host of challenges, including his Russian-backed separatists on the defensive in Ukraine. But his control of the energy market has positioned Russia to ride out the current crisis.

Here’s how he’s done it:

Former YUKOS chief Mikhail Khodorkovsky stands behind steel bars in a court in Moscow, August 3, 2004. REUTERS/Alexander Natruskin Taking Control of the Russian Oil Industry

In October 2003, Putin arrested Russia’s richest oligarch, Mikhail Khodorovsky, then sold his oil giant, Yukos, for a fraction of its value to the state-controlled OAO Rosneft, now the largest listed oil producer in the world.

Khodorovsky’s imprisonment in Siberia brought the rest of the oligarchs to heel, and Putin became the de facto CEO of Russia, Inc. He also moved aggressively to bring Gazprom, the Russian oil company privatized in the 90s, back under government control.

By December 2013, Putin apparently felt confident enough in his position to release Khodorovsky after a decade in prison.

This month an international arbitration court ruled that Yukos’ dismantlement damaged shareholders, who are entitled to $50 billion from Moscow. But claimants will likely spend more years chasing compensation than Khodorovsky spent in Siberia.

Russian President Vladimir Putin (R) and German Chancellor Gerhard Schroeder smile at the entrance into the Konstantinovsky Palace as they meet outside St.Petersburg October 7, 2005. REUTERS/ITAR-TASS/PRESIDENTIAL PRESS SERVICE Co-opting Germany and Other Rivals

In December 2005, German Chancellor Gerhard Schroeder lost his country’s federal elections. He immediately became chairman of Gazprom.

In 2009, when Gazprom cut off gas to Ukraine, the flow to Europe slowed to a trickle as well. As a result, Germany and Russia agreed to build their own gas pipeline, the Nord Stream, under the Baltic Sea, which partially bypasses Ukraine’s pipeline to Europe.

Russia’s charm offensive has also meant awarding huge contracts to the German conglomerate Siemens, French arms manufacturers, and some of the world’s biggest oil companies. These deals have helped to mitigate attempts to halt Russia’s hegemony in Europe or impose sanctions.

Even as violent clashes took place in Eastern Ukraine and Crimea in April 2014, Schroeder celebrated his 70th birthday in St. Petersburg and was photographed warmly embracing his friend Putin, who he once described as “a flawless democrat.”

Workers with Belarus' gas company deliver a gas cylinder to a villager in the settlement of Kamenka, during a gas pricing dispute in December 30, 2006. REUTERS/Vasily Fedosenko Punishing the Pawns

In the winters of 2004 and 2006, Russia’s Gazprom severely cut gas supplies to Belarus, a move that helped win the country’s compliance in negotiating gas transfer prices. It’s now a member of the Eurasian Customs Union, Putin’s free trade association of former Soviet republics set up to compete with the European Union.

Latvia and Lithuania have been cut off from Russian gas supplies several times as punishment for their alleged mistreatment of Russian minorities or for awarding refinery or construction contracts to European rather than Russian companies. Ukraine and its downstream customers in Europe drew the most severe punishment when gas supplies were restricted in 2006 and 2009.

A pro-Russia rally in Sevastopol, on the Crimean Peninsula, in 2014. Buzzfeed Harrassing Ukraine

Russia has tried to control Ukraine — mostly through corruption and intimidation — since the former Soviet republic declared independence in 1991.

In December 2014, the Kremlin-allied president Viktor Yanukovych rejected membership in the European Union, against the wishes of most Ukrainians, in favor of joining Russia’s Eurasian Customs Union. When protests erupted, Yanukovych’s forces fired on the crowds. Amid the ensuing chaos, he fled to Russia, leaving a trail of corruption in his wake.

In the most recent maneuvers, when Kremlin-allied president Viktor Yanukovych, was deposed and fled the country earlier this year, Russia deployed troops along the border. Separatist movements were fomented in Crimea and the eastern and southern portions of Ukraine, where many ethnic Russians live. (Not coincidentally, these regions contain sizeable oil and gas reserves.)

Crimea was seized in February 2014 by Russian-backed separatists who declared allegiance to Moscow. On March 26, 2014, they staged a referendum that supported the immediate annexation of the territory by Russia.

In July, having seized Crimea’s territorial waters along with the region itself, Russia announced Gazprom was fast tracking its South Stream pipeline, which will travel under the Black Sea near Crimea. This gas will flow directly to Europe, emptying the Ukrainian pipeline of Russian gas exports. The line will enter Bulgaria, a Putin ally and recipient of massive Russian investment. Although recent events in Ukraine have complicated the project, there’s little doubt it will be completed.

Business Insider/Mike Nudelman Blocking Azeri Gas to Europe

An attempt by Western governments to build a 2000 gas pipeline, known as the Nabucco pipeline, from Azerbaijan through Georgia and Turkey to Europe — thereby breaking the EU’s dependence on Russian gas, was put on hold after Russia’s invasion of Georgia, and subsequently ran into financial trouble.

Its failure was due, in part, to Russia’s ability to strongarm various Central and Eastern European countries into accepting its South Stream pipeline proposal, thereby making the eastern portion of Nabucco less financially viable, along with other proposed alternatives.

In April, to underscore its opposition to any development in the Caspian Sea, Russia launched military exercises involving dozens of ships and gunboats. Moscow and Tehran have also insisted that no other military or naval power be allowed in the region, namely the U.S.

People shout slogans and carry a banner that reads "Ban the shale gas tests through hydraulic fracturing" during a rally in central Sofia, Bulgaria, on January 14, 2012. REUTERS/Tsvetelina Belutova Funding Anti-Fracking Campaigns

In June, the head of NATO made a startling charge: Russia, he said, was secretly supporting NGOs that were opposing hydraulic fracturing — or fracking — in promising shale oil and gas regions, notably in France, Poland, and Ukraine. Fracking does present significant environmental drawbacks, including the release of methane and, it’s thought, a risk of triggering earthquakes. The use of natural gas in general, while cleaner than coal, also releases carbon into the atmosphere.

Russia has its own reaons for quietly opposing fracking, says NATO’s Anders Rasmussen: "obviously to maintain European dependence on Russian gas."

Technicians walk beside pipes for the Nord Stream pipeline at a storage facility in Mukran on the Baltic sea island of Ruegen April 8, 2010. REUTERS/Christian Charisius What Happens Next

In May, a missile attack over Ukraine hit a commercial jet, killing 298 passengers. Putin has denied any Russian involvement, but there seems little doubt that Russian-backed rebels were behind the shooting.

The tragedy has convinced Europeans to impose tough sanctions. Last week, Putin countered with sanctions of his own.

Now, the question is who will blink first.

In recent days, Russia began massing troops on the Ukraine border, sparking concerns Putin could stage an invasion.

Whether or not he does, it’s clear that Europe’s dependence on Russian natural gas is severely limiting its diplomatic options. Having taken care of the competition — Ukraine, Georgia, and Azerbaijan — Putin can enjoy a profitable energy market in Europe for the foreseeable future.

Europe without Russian gas would be a very chilly place.