With oil prices near $60/barrel, it seems like the best of times for oil companies. But it easily could be the worst of times. Recall the tumultuous sequence of events that followed the last global surge in commodity prices, during the 1960s and 70s.

In the mid-1960s, copper prices jumped by more than 50 percent and then kept on rising. 1968 was the best year yet for Anaconda Copper’s Gran Mineria mine in Chile. Profits had more than doubled. US-based Anaconda contended for the title of the world’s largest metal producer; and in Chile, Anaconda owned the world’s largest open-cast copper mine.

Then, in 1969, the Chilean government announced it was revising Anaconda’s concession. Two years after that, the government seized the mine, paying Anaconda little compensation. Following this political risk loss in Chile, Anaconda Corporation suffered a financial meltdown. By 1977, Anaconda had ceased to exist, its remaining assets snapped up by Atlantic Richfield.

The demise of Anaconda was only one among many such incidents. During the 1960s and 70s, host-country seizures of foreign direct investments claimed a staggering one-fifth of the value of US investment in the developing world. Well over 1,500 foreign affiliates of multinational firms were taken, many with little or no compensation.

It is widely assumed this could never happen again. The conventional wisdom has it that these expropriations were driven by ideology – communism and post-colonial nationalism. The incidents most remembered today are the seizures of private property that accompanied upheavals like the Cuban revolution. These were complete, indiscriminate, uncompensated and clearly political.

But the conventional wisdom is wrong. The number of such indiscriminate events was dwarfed by so-called “selective” expropriations. In the majority of cases, only one or two foreign-owned firms were taken in a country: the juiciest targets. The rest were left untouched. In aggregate, these “selective” seizures accounted for nearly 60 percent of the expropriations that took place between 1968 and 1979.

These “selective” seizures had a strong economic component. When the profits from copper soared, the Chilean government began to covet Anaconda’s mine. Around the world, the same story. As copper profits soared, copper mines were seized by host governments. Three mines, in Panama, Mauritania, and the Congo, in 1975; one more, also in the Congo, in 1976.

This was true for other metals as well. Gold and sliver prices climbed sharply from 1967 to 1972, and expropriations followed, peaking when five mines were seized, on opposite sides of the globe, in 1975 and 1976.

But where this was most true was in oil. The staggering price rises in oil made the markets for precious metals seem lethargic by comparison. In 1973 alone, oil prices jumped by 600 percent. But US and European oil execs negotiated hard: even as war raged around them in the Middle East, the oil majors refused to give in to host government demands for a greater share of the profits.

And so, when the nationalizations came, they were complete and total. Nearly the entire industry – billions of dollars in US and European investment – was nationalized. In almost every country of the Middle East, the foreign owners were thrown out, with little compensation.

Today, over three decades later, this pattern is repeating itself. China’s ferocious demand for raw materials has produced another surge in world commodity prices. Copper prices have doubled in only two years. Gold is up nearly that much since 2002, and oil, about the same.

The resulting tremors in political risk have already been felt. In Peru, new taxes imposed on foreign-owned mines. In Venezuela, proposed changes to energy laws that would cut into the profits of foreign oil investors. In Bolivia, an escalating movement for nationalization. And in Russia, a demand for $1 billion in unpaid taxes from a project jointly owned by British Petroleum and a Russian company.

Oil executives have once again taken a hard negotiating line. The head of British Petroleum’s Russian operations lashed out at the Russian government in a public forum. The president of Exxon-Mobil, responding to rumors that the terms of its Venezuela contracts might be changed, shot back: “There’s not a country in the world we have to be in.”

True enough, but it could become a prophecy. When profits at foreign operations skyrocket, so do the risks. This is especially true for oil and mining – host governments see foreign companies making “excess profits” on their country’s natural resources. This makes foreign investors a lucrative, and politically vulnerable, target.

With global commodity prices soaring, investors have the chance to avoid a repeat of past mistakes. Oil and mining companies should put a good portion of their soaring profits right back into the host countries, via visible community investments. They should be flexible on contract terms early on. Once political momentum builds towards nationalization, no amount of after-the-fact concessions are likely to stop it.

And above all, oil and mineral investors must recognize that their contracts with foreign governments work because they fit global conditions, not because of their iron-clad legal language. If the contracts are out of step with reality, they create political risks. If investors bear this tenet in mind, and have sufficient luck and ingenuity, they may avoid Anaconda Corporation’s miserable fate – no matter how high oil prices soar.

This article was originally published on Countryrisk.com, before I sold the site to Roubini Global Economics.