That scary incident took place in June 2005--hardly the first confrontation with the Kazakhs and certainly not the last. Still, AES soldiered on. In a 12-year sojourn in the former Soviet republic, it invested at least $200 million, becoming one of Kazakhstan's largest providers of electricity. But now, three years after the Financial Police raid and facing $200 million in potential fines, AES is largely throwing in the towel. It is closing a deal to sell its main assets in Kazakhstan for what appears to be a fire-sale price.  A $14 billion (sales) firm with headquarters in Arlington, Va., AES is in the business of supplying power, for the most part in developing countries (among them: Cameroon, Brazil, Colombia and Pakistan). So it has had plenty of experience dealing with nasty legal regimes and expropriations of foreign capital. But Kazakhstan, where it had not just contract and regulatory disputes but also the threat of criminal investigations, was too much for it.  AES' hosing in Kazakhstan is a distressingly familiar sign of the times for U.S. and European corporations trying to do business in poor but resource-rich countries. Venezuela, Bolivia and Ecuador badly need foreign investment and know-how. Yet they're making it tough for outsiders to make a decent return on investment. ExxonMobil (nyse: XOM - news - people ) has been in a tense legal standoff over frozen assets with Venezuelan President Hugo Chávez since last year. Ecuador is using its court system in an attempt to extort as much as $16 billion from Chevron as compensation for environmental damage that was caused mostly by the Ecuador national oil company after Chevron left. Russia has come to rely on spur-of-the-moment environmental laws and fines as leverage to force Western partners to sell at depressed prices. Thus was Royal Dutch Shell (nyse: RDSA - news - people ) squeezed out of its majority stake in the Sakhalin oil bonanza for pennies on the dollar.  Kazakhstan's 30 billion barrels of reserves make it the world's eleventh-largest repository of oil. This vast Central Asian nation of 15.3 million also has coal, gold and uranium. It has attracted $15 billion in U.S. money, most of it oil-related. President Nursultan Nazarbayev, a former Soviet official, has ruled with a tempered-steel grip since independence in 1991 by focusing on the economy--Kazakhstan's GDP last year jumped 8.7%--and opening doors to outside investors. "It's a lot easier to do business in Kazakhstan than Russia," says a Western diplomat in the region.  But that official policy hasn't kept authorities from hassling foreign operations. In November a regional Kazakh environmental regulator fined Chevron's Tengiz oilfield project $310 million for alleged violations involving the improper storage of sulfur. Chevron insists it has dealt with the sulfur safely and legally, and is contesting the fine.  The Tengiz problem is a mere puddle next to the troubles at Kashagan in the remote North Caspian Sea, the world's largest oilfield discovery in the last three decades. Citing production delays and cost overruns, and threatening new laws and fines to protect the wilderness, the Kazakh government has extracted critical concessions from Western companies developing the field. In January the chief executives of Exxon, Shell, France's Total and Eni of Italy flew to Astana, the new northern capital decreed in 1997 and built almost from scratch. There, in a nine-hour meeting at La Rivière restaurant, the oil giants agreed to fork over $5 billion to compensate Kazakhstan for delays and potential lost revenue, and let KazMunayGas, the state oil company, double its stake in Kashagan to 17% for the bargain price of $1.8 billion.  It doesn't stop there. Foreign firms in Kazakhstan, which pay a maximum tax rate of 30%, plus value added taxes, have come to expect frequent visits from the regional taxman. ArcelorMittal, the world's biggest steel company, has been fighting $2.5 billion of tax claims associated with its coal- and steel-producing assets in the country. The Ministry of Finance claimed that ArcelorMittal should, among other things, be paying Kazakh taxes on the income of a subsidiary in the United Arab Emirates. ArcelorMittal says it has paid taxes in accordance with the original privatization agreement and recently won court victories in the case. (Unrelated to the tax cases, ArcelorMittal has had serious safety issues: 71 Kazakh miners have died in two accidents in the last three years.)  Houston contractor Parker Drilling (nyse: PKD - news - people ) has had its share of woes since building Sunkar, a barge designed to drill in the icy, shallow waters of the Caspian. Parker has spent five years defending itself against Kazakh accusations that it did not pay taxes on reimbursements for upgrading the giant barge, even though most of the modifications were completed outside Kazakhstan. Total fines: $126 million, most of which Parker passed on to its oil clients. In March Parker itself finished paying a $51 million tax bill related to Sunkar. That's serious coin for a company that last year earned $104 million on revenue of $655 million.  Does Kazakhstan really want to lure U.S. companies? That is its paramount concern, says Galym Orazbakov, Minister of Industry & Trade. He traveled to the U.S. in December to raise funds for infrastructure projects. Since then the government has taken out an ad in the Wall Street Journal to highlight its keen interest in "deepening economic ties with the U.S."  AES entered Kazakhstan in 1996, paying $3 million for Ekibastuz gres-I, the nation's biggest power plant. While that may sound like a steal, the investment required a leap of faith. A relic of Soviet engineering, the coal-fired plant in northern Kazakhstan was designed to generate 4 gigawatts. At the time, it was producing less than a tenth of that. Still, AES embraced the risk, immediately buying enough coal to ensure that Ekibastuz could produce power through its first winter. The company ended up investing $200 million to increase capacity at the plant. It also purchased a nearby coal mine to stoke the plant and concessions on two hydro power producers in eastern Kazakhstan. At its peak AES produced 25% of Kazakhstan's power.  Sidebar: Its Good to Be President
After an armed seizure, years of criminal investigations and millions of dollars in suspicious fines, U.S. power company AES Corp. is retreating from Kazakhstan--the latest victim of cronyism in poor, resource-rich countries.