Apache chairman Steven Farris speaks at an energy conference in Houston in this March 8, 2012 file photo. Oil company Apache, the largest U.S. investor in Egypt, sold part of its stake to a Chinese firm. (RICHARD CARSON/REUTERS)

Since sinking its first oil well in Egypt’s Western Desert in 1994, Houston’s Apache Corp. has locked up exploration rights for nearly 10 million acres and become the largest U.S. investor in the country — a corporate symbol of America’s stake in Egypt’s success.

Last week, amid what company executives said was uncertainty about the country and a shareholder call to “validate” its presence there, Apache announced that it would sell a third of its Egyptian operation to China’s Sinopec and invest the $3.1 billion payment elsewhere.

The sale, Apache said, was part of a broader shuffling of its business, not solely a decision to divest from Egypt, where it will continue to manage the joint venture with Sinopec and maintain a 9,000-person workforce.

But it’s also a sign of the difficulties ahead as Egypt tries to heal its deeply divided society, a process considered critical to U.S. interests in the region. Facing a collapse of new foreign investment, growing debt and a multitude of economic constraints, the decisions made by companies like Apache in coming months could prove critical to whether the existing military government or any successor is able to improve conditions, generate jobs — and succeed where ousted president Mohamed Morsi failed.

Business officials acknowledge that it will be difficult to undo the damage of the past year’s turmoil and revive the country’s ability to grow on its own. According to the latest Wold Bank data, foreign firms globally were investing about $11 billion a year in Egypt as of 2007. But in 2011, they took $500 million out of the country.

“Anybody looking at Egypt now is saying, ‘Wait and let’s see what happens,’ and that is completely understandable,” said Hisham Fahmy, head of the American Chamber of Commerce in Egypt. “It is going to take a bit more work.”

The Apache sale does not necessarily augur an exodus of other U.S. firms from Egypt. Chevron recently announced the sale of its network of gasoline and fuel stations in the country. But Fahmy said that other large U.S. investors — firms such as General Motors, Procter & Gamble and Microsoft — said in recent meetings that despite the country’s troubles, they had no plans to scale back.

U.S. government statistics indicate an economic relationship in limbo. According to Bureau of Economic Analysis data, U.S. companies have continued through two years of political and economic turbulence — from the popular uprising that led longtime president Hosni Mubarak to leave office, to Morsi’s ouster — to keep local earnings there, whether to reinvest or because of U.S. or Egyptian tax laws.

The total value of private U.S. holdings in Egypt actually rose over the past two years, from $14 billion to more than $17 billion. But the increase was more than accounted for by the locally generated earnings from existing investments, and it was concentrated in the oil and gas sector.

Elsewhere in the Egyptian economy — in the manufacturing, chemical, technology and other industries the country is hoping desperately to expand to generate jobs and growth — money has been trickling away. Major international banks and investment firms have been quizzing local executives about whether the country is a safe place to invest or if security conditions and economic policies will remain erratic.

Hard currency has become so scarce the Egyptian central bank auctioned dollars and other major currencies this week so import firms could pay for staple goods such as milk and wheat. Since Mubarak’s fall from power, Egyptian judges have invalidated prior sales of some state-owned assets going back as far as 15 years on the grounds that they were sold too cheaply in deals that proved the corruption of the prior regime. The government is supposed to again take over those companies. While the investors are supposed to get their money back, the rulings have been a blow to any image of Egypt as a predictable place to do business.

There is a strong nationalistic streak in the Egyptian economic debate, stemming from the era when military leader Gamal Abdel Nasser nationalized much of the economy. Apache executives did not explicitly raise that risk in announcing the sale. But in a recent call with analysts, chief executive G. Steven Farris acknowledged the pressure from stockholders to justify a continued stake in Egypt.

While Apache’s production in the country has continued “uninterrupted” through what amounts to two revolutions, Farris said, “we need to find a way to validate the value of Egypt. . . . We recognize the uncertainty.”

The current government, installed after the military removed Morsi in a step that sparked deadly clashes throughout the country, may have some breathing room. Billions of dollars in loans from Persian Gulf countries such as Saudi Arabia have for now stabilized Egypt’s finances and allowed the cabinet to announce new infrastructure projects meant to jump start hiring.

Morsi struggled to launch any such initiatives. With the country’s deficit soaring and its reserves of foreign exchange dropping sharply because of the need to pay for needed food and other imports, he was limited in what he could do by demands from the United States, the International Monetary Fund and others that he tackle longstanding economic problems before qualifying for any financial assistance.

Most of a $1 billion U.S. debt relief package offered by the Obama administration remains on hold.

But the loans from the nearby gulf monarchies won’t fix Egypt’s problems. Officials at the IMF worry that much of it is going to pay for expensive fuel subsidies and other costs that are driving up the government’s annual deficit — and leaving whatever government ultimately takes over deeper in debt and with even more difficult problems to solve.

And until the country’s political situation is settled, with a government that the U.S. and other major nations formally recognize, any discussion of possible help will be limited.

“We stay in touch on technical issues . . . not with the political authorities,” IMF managing director Christine Lagarde said last month. “We try to be as ready as we can when the time comes for Egypt to re-initiate discussions with us.”