Ukraine’s war with pro-Russian separatists is not only being decided in the battlefields of eastern Ukraine.

Oddly enough, the Ukrainian government’s recapture of Slavyansk and its advance on Donetsk were only made possible because of a decision of the Bulgarian government. The decision was to stop the ongoing construction of South Stream, a new gas pipeline that would have circumvented Ukraine to deliver Russian gas to energy-hungry Europe.

Bulgaria made this decision after a low-key visit from three U.S. senators, including John McCain (R-AZ), Chris Murphy (D-CT), and Ron Johnson (R-WI), who convinced the Bulgarian government to stop work on the pipeline.

Bulgaria’s decision exposed a Russian weakness: its economy is not diversified. It is completely dependent on its gas and oil exports, so energy politics may be the last check on Russia’s creeping intervention in the Ukraine conflict. As McCain explained, all Putin’s “got is gas and oil,” and the pipeline delay restricts Russia’s ability to sell its oil and gas resources.

The Russian ruling oligarchy is already taking the first blow connected to the reduction of energy revenues because it owns all the gas exploitation and export companies. The second blow, which will take longer to land, will fall on the broader Russian economy.

In the short term, Russian president Vladimir Putin will be hard pressed not to alienate the gas oligarchs in his inner circle. Over the longer term, he will confront the reaction of the Russian population if the economy goes into stagnation.

The negotiations over South Stream are not over yet. The pendulum of Bulgarian policy can still swing toward Russian interests and untie Putin’s hands. On July 7, at Bulgaria’s invitation, Russian Foreign Minister Sergei Lavrov went to Sofia on a working visit to discuss the suspended construction of the South Stream pipeline. Sofia’s ultimate decision will depend on both economic and geopolitical factors.

On the economic side, the country’s membership in the EU raised unrealistic expectations among the population for immediate economic prosperity. Meanwhile, Bulgaria is often seen from the outside as a burden on the EU’s budget. Virtually every commentary on the country includes the words “the poorest country in the European Union.” Bulgarians have internalized this message.

Bulgaria can only improve its economic situation by looking at the big picture. Bulgaria can be a very important geopolitical strategic asset to the EU and the Western democracies in general. The question is whether the EU and the United States are willing to support Bulgaria in order to bring stability to its frontiers. If this happens, the Bulgarian government won’t be dependent on the short-term profit from projects such as the South Stream pipeline.

Bulgaria needs outside help to increase growth-promoting investment. Reducing Bulgaria’s negative image has to be the first step towards that goal. That should be Bulgaria’s bargaining chip when refusing to take Russian gas money. Bulgaria gains foreign investment from the West; the EU and the United States get a united, pro-Western Ukraine.

Of course Bulgaria needs a knowledgeable government that can understand its geopolitical leverage and also what kind of investment it needs to promote. Not all investment is related to economic growth. Bulgaria’s pendulum swing will depend on the long-term vision of its politicians.

The ultimate path to peace, however, lies with Russia itself, and its need to diversify its economy. A less gas-and-oil-dominated Russian economy would make Russia appreciate of the virtues of access to the EU market and how Ukraine can serve as a bridge to that market. A more diverse Russian economy, in other words, will mean a more peaceful Russian external politics. By canceling the South Stream pipeline construction and encouraging the country to rethink its economic portfolio, Bulgaria is ultimately doing Russia a favor as well.

Alexander Atanasov is a contributor to Foreign Policy In Focus.