* Gas plant siege stirs fear of rising costs
* Parliament votes in long-awaited oil, gas law
* Costs seen rising across North African oil sector
By Emma Farge
GENEVA, Jan 21 (Reuters) - Investment in Algeria's oil and gas sector may fall as concerns about the costs of security after a bloody siege at a desert gas plant eclipse the impact of a hydrocarbon law designed to win over foreign firms, executives and analysts said on Monday.
Algeria's parliament acted quickly on Monday to endorse an oil and gas law, cancelling a windfall tax on foreign firms, in a move seen as a bid to reassure foreign investors and reverse declining interest in the OPEC member.
But executives say the attack, which left more than 60 people dead including many foreign workers, could mean that investment in Algeria and other oil-producing neighbours such as Libya and Mauritania lags behind other regions.
"Costs that are already extremely high will become even higher," said Repsol's Algeria country manager Gabino Lalinde in a telephone interview.
"Security risks and this new cost escalation will make Algeria less attractive to international oil firms," he added.
The Spanish firm produces around 8,500 barrels of oil equivalent per day in the country and has facilities deep in the southern Algerian Saharan desert and near BP's In Amenas site.
Algeria's oil and gas sector, which accounts for 98 percent of the country's exports, has struggled to lure in investment in recent bid rounds as executives eye the booming sectors of Iraq and east Africa.
Analysts said that Algeria's new law could be too late to reverse the investment trend.
"The change in the hydrocarbon law has come two-three years too late. They've already had unsuccessful bid rounds and the IOCs (international oil companies) have been voting with their feet," said Charles Gurdon, managing director of Menas Associates, a political risk consultancy.
Libya and Algeria are Africa's third and fourth largest oil producers with Libya also the largest oil reserves holder on the continent.
Together with Egypt, they are important gas suppliers to Europe.
Alone among its neighbours, Algeria has so far been largely untouched by uprisings in 2011 that ousted leaders in Egypt, Libya and Yemen.
Any drop in Algerian investment could have serious consequences for a country which relies heavily on oil and gas revenues to pay for its 6 million tonnes a year of grain imports, seen as vital to ensuring domestic stability.
Oil majors such as BP and Total have been gradually reducing production in Algeria by either selling assets or letting existing investments lapse, raising concerns that there will not be enough new projects to maintain output.
Edward Bell of the Economist Intelligence Unit said that declining investment in Algeria's the oil and gas sector could affect spending on infrastructure and social projects.
"For now Algeria has comfortable reserves, but in the longer term its fiscal position could be impacted," he said, adding that youth unemployment - a feature of Arab Spring countries - also plagues Algeria.
Libya ranked 12th and Algeria 13th out of 17 major economies in the Middle East and Africa in a survey by the Economist Intelligence Unit.
Algeria needs an oil price of $121 to balance its books, according to a November estimate from the International Monetary Fund, as falling oil production and low gas prices hit earnings.
The chief executive of Statoil, which is still missing workers at the Algerian gas facility, said on Monday that the attack represented a "crossroad" for the global oil and gas industry that would raise many questions.
"We have a responsibility to run our business and support daily operations ... we cannot and will not let a terrorist attack interfere in our determination," Helge Lund told a news conference.
BP has evacuated workers from Algeria and an industry source said that other firms had taken steps to remove foreign employees from desert sites.
Neighbouring Libya has also beefed up security in its oil fields and energy firms were considering similar measures in Egypt as Islamist militants threatened to attack new instillations in north Africa.
The In Amenas attack, which occurred close to the border with Libya, could also have implications for that country's oil and gas sector as long-standing clients begin to show frustration at supply disruptions caused by protests and strikes.
"The industry is going to assume that everything in North Africa is affected in terms of security, including Libya and also Morocco and Mauritania," said Gurdon.
Some Libyan oil fields such as Italian group Eni's Elephant are located several hundreds of kilometres across the desert from In Amenas, where the hostage tragedy unfolded this week.
Several U.S. oil firms have yet to return to resume exploration in Libya after the 2011 conflict due to security concerns.
"Should Libya be subject to similar attacks by Al Qaeda in the Islamic Maghreb, we see a particular downside risk to Libyan output prospects for this year and for longer-term production prospects, as foreign firms will be reluctant to resume exploration and return expatriates to Libya," said Amrita Sen, Chief Oil Analyst at consultancy Energy Aspects in London.