(Corrects para 23 to show Apache sold 33 pct stake in Egyptbusiness, not entire stake)
* Some U.S. companies pull out of Libya, Algeria and Egyptas risks mount
* U.S. shale boom, discoveries elsewhere present newalternatives
By Lin Noueihed
LONDON, Oct 4 (Reuters) - Two years of turmoil since theArab Spring and some of the toughest terms in the business haveled international oil companies to reassess their role in NorthAfrica, with U.S. firms looking keenest to leave.
Libya and Algeria are among Africa's top four oil producers.Together with Egypt, they are major suppliers of gas to Europeand their budgets depend heavily on energy revenues.
But Libya has not turned into the bonanza some foreign oilfirms had hoped for, while the cost to reward ratio of producinggas in Egypt and Algeria looks less appealing as new finds inmore politically stable places like Tanzania offer alternatives.
For some U.S. companies, the prospect of shedding non-coreassets and cashing in on the shale gas boom at home seemsincreasingly attractive, analysts say.
At least seven firms, five of them American, have abandonedprojects, frozen activities or sold stakes worth billions ofdollars in Libya, Algeria and Egypt in the past 18 months alone.
"The politics of the Middle East and North Africa have madethings more difficult for all companies but American companiesare not tied to North Africa," said John Hamilton, North Africaanalyst at Cross-border Information.
"That's in contrast to companies to like Repsol,Eni, Total and even BP. For them,these are large deposits on their door step so it makes moresense for them to stick it out."
"For ExxonMobil, why bang your head against a brickwall in Libya, spend a fortune on dry wells and deal with thepolitical situation that is so complex? If you can go elsewhereand get a good return for less political risk then why not?"
A "TOXIC COCKTAIL"
Exxon said in September it was scaling back in Libya, whileRoyal Dutch Shell abandoned two exploration blocksthere last year. Both had made disappointing finds.
Others have been slow to resume exploration since the 2011war. Those that are heavily invested have paid the price.
A mix of labour strikes, militias and political activistshave blocked several oil fields and ports since the end of July.
Repsol and Eni, involved in western Libya, haveseen output largely restored since fields reopened lastmonth.But companies invested in eastern Libya are entering athird month of closures at several important export terminals.
Even before the closures, it emerged that Marathon Oil would sell its stake in Waha Oil Co, a consortium withLibya's National Oil Corp (NOC) and two other U.S. firms.
"Libya is an expensive place to do business. To justify thetough terms, oil firms needed very good finds but even beforethe revolution, exploration results in general had not metexpectations," said Beth Hepworth, co-director of FrontierResearch and Advisory, which also publishes Libya Monitor.
"Couple that with the deteriorating security environmentafter 2011 and the uncertainty over the political roadmap, andyou get a toxic cocktail."
Keen to keep foreign energy firms on board, the governmentis revising terms for existing investors and promising betterreturns in the next licensing round due next year.
But analysts say Libya will not realistically be able tooffer new blocks until production is largely restored. And theoil sector has become a political hostage, repeatedly held toransom by armed groups pressing local or political interests.
"It all comes back to politics," said Hepworth. "If you area big company you might decide to wait for more visibility."
CONTRACTS, OBLIGATIONS, INVESTMENTS
In neighbouring Algeria, an attack on a gas plant in theSahara desert in January triggered an exodus of expatriateworkers and forced energy companies to ramp up security. Butterms were already so tight that there was little appetite amonginternational oil companies in the last licensing round.
U.S. ConocoPhillips said last year it would sell itsAlgerian unit to Indonesia's Pertamina for $1.75 billion. Hess is selling one if its two Algerian oil stakes to Cepsa,which is already heavily involved there, and Britain's BG Group also plans to go, sources said in April.
The government passed an amended hydrocarbons law in Januarybut industry sources said the changes were not enough to counterthe prospect of higher security costs after the In Amenas siege.
In Egypt, two years of upheaval have hit government coffers,raising concerns that it cannot pay existing firms to produceits gas let alone entice investors to develop new finds. Itplans to compensate the firms but that comes too late for some.
Apache Corp. said in August it had sold 33 percentof its Egyptian business to Sinopec for $3.1 billion, followinginvestor concerns over its exposure there. Apache has soldnon-core assets globally to focus on U.S. onshoreproduction.
But for companies that are heavily invested in production,the decision to go is not as easy as it was for Exxon or Shell,who were exploring. For all those who have left, for manyinvestors, particularly Europeans, it makes sense to stay on.
Statoil and BP did not abandon Algeria after the attack ontheir joint venture at In Amenas. Libya's oil minister said thisweek that Eni, the top foreign oil company in Africa by volume,was committed to Libya and BP would resume its actitivity soon.
Germany's Wintershall, involved in the Mabrouk jointventure, said leaving Libya, where it has been active since1958, was not a topic of discussion.
"You are not in a position to say: This isn't fun anymore sowe will leave. You have contracts, obligations, billions ofdollars worth of investments," said a senior executive of amajor energy company working in Egypt. "We don't believe Egyptis going to go the Syria route." (Addiional reporting by Dmitry Zhdannikov in London, editing byWilliam Hardy)