A rising Russian politician from St. Petersburg and a Texas oil executive from Wichita Falls met on frigid Sakhalin Island, off Russia’s eastern coast, in the fall of 1999 to begin what would turn out to be a warm, prosperous relationship—both for the men, who were born just months apart in 1952, and for those they were there to represent.

At issue was whether ExxonMobil would proceed with a multibillion-dollar investment to develop a giant project drilling for oil and natural gas in the icy waters off Sakhalin. By all accounts, Rex Tillerson, then in charge of the company’s Russian division, and Vladimir Putin, then the newly appointed prime minister of Russia, heard what they needed to hear at that meeting. Twenty years later, Exxon estimated the Sakhalin-1 project will have delivered a total of $89 billion to the Russian state treasury by the time the oil is tapped out, in about 2050.

Sakhalin was also extraordinarily successful for Exxon, bringing in many billions in revenue. In addition, it demonstrated that the company could drill extraordinarily complex wells in a region where the temperature could dip to -45 degrees Fahrenheit. Wall Street analysts praised Exxon’s ability to pull it off as a sign of the company’s globe-trotting savvy and noted that it was a financial home run.

Tillerson’s success at negotiating Kremlin politics and securing the deal was critical to his becoming chief executive and chairman of Exxon seven years after that initial meeting with Putin. And his experience negotiating with the Russian, as well as other global leaders, had much to do with his being tapped by Donald Trump—who called him a “world-class player” capable of making “massive deals”—to serve as Secretary of State in 2017.

For Putin, the deal provided much needed revenue for Rosneft, a Russian state-controlled oil company that had a minority stake in Sakhalin, as he officially began running the country following the resignation of Boris Yeltsin on the final day of 1999. It was, at the time, the “single largest foreign investment in Russia,” Tillerson later wrote, adding that Exxon believed projects such as Sakhalin “are vital to developing a prosperous and democratic Russia.”

But Exxon’s big bet on Russia is now over, and Tillerson’s vision of oil money fueling a democratic Russia appears to have been a pipe dream. This week, in the wake of the Russian invasion of Ukraine, the company announced that it would discontinue its Sakhalin operations and not make any new investments in Russia. The Reuters news agency estimated that Exxon’s Russian assets were valued at $4 billion.

The Exxon decision follows similar moves by its peers. In recent days, BP, Shell, and Equinor all announced they would exit their energy investments in Russia. France’s TotalEnergies said it would not make future investments. While the investments of some of the others are larger—BP’s sale of its stake in Rosneft could result in a $25 billion hit to its earnings—Exxon’s entanglements with Russia and Rosneft are, in many ways, longer-lived and deeper.

Indeed, Exxon invited Rosneft into the Permian Basin in 2013, selling it a minority stake in an exploration effort on the 220,000-acre La Escalera Ranch southwest of Fort Stockton. That marks the first—and, to date, the only—time a Russian state-controlled oil company acquired oil-and-gas assets in the United States. The Dallas Morning News summed up the deal pithily: “The Russians are coming to West Texas to learn about fracking.” Putin was so pleased about it that in June 2013 he awarded Tillerson the Order of Friendship, a high honor for a foreigner in Russia and the high point in the Exxon-Russian relationship.

The Permian figured into a much larger deal Putin and Tillerson had worked out. In 2011, Tillerson—by then Exxon’s CEO and chair—agreed to invest $3.2 billion to drill for oil in the ice-choked Kara Sea in the Russian Arctic, as well as in the Black Sea. ”Today really is a historic day,” Tillerson said at the signing ceremony, hosted at one of Putin’s country homes. ”It marks the beginning of a new and broader relationship.”

Three years later, Russia took the Crimean Peninsula from Ukraine. The U.S. imposed sanctions on the president and chairman of Rosneft, former KGB operative Igor Sechin, and then on Rosneft itself. Those sanctions prohibited the export of technology to Russia to help it drill complex wells, effectively killing Exxon’s Russian expansion. Following further sanctions resulting from Russia’s interference in the 2016 presidential election, Exxon announced in late 2017 that it was ending all of its joint ventures with Rosneft, from the Kara Sea to the Permian, except for Sakhalin. The company booked an after-tax loss of $200 million.

Exxon kept right on running Sakhalin, until now. In announcing its divorce from Russia this week, the company didn’t say anything about why it hadn’t pulled out of the country sooner. Why not when Putin took Crimea by force, or when he sought to undermine faith in America’s democratic system? (In fairness, these are questions any number of others doing business with Russia could be asked.) Exxon stands to lose billions by leaving Russia—not to mention much more from the prospective development of a liquified natural gas terminal on Sakhalin.

This week’s decision may have been made easier by the fact that Sakhalin’s peak years of profit are behind it. An Exxon executive said during a call with investors on Wednesday that Russian operations contribute no more than 2 percent of the company’s profits. “We abhor Russia’s military action in Ukraine and are deeply saddened by the loss of lives and the needless destruction,” said Darren Woods, who succeeded Tillerson as Exxon’s CEO in 2017, on that same call. Woods added that the sanctions imposed by the U.S. and its European allies in response to Putin’s aggression make it impossible to continue to lead the Sakhalin project.

Exxon and Russia’s long relationship started with high hopes for democracy. It’s ending in bitter disappointment, despite the rich rewards both reaped along the way.