* Mali's neighbours, junta agree transition to civilian rule
* Accord means ECOWAS will lift sanctions
* Deal comes as northern rebels declare independence (Releads with junta, ECOWAS deal)
By Bate Felix and Adam Diarra
BAMAKO, April 6 (Reuters) - Mali's two-week-old junta agreed on Friday to hand over rule to civilians in return for the end of sanctions by worried neighbours who had threatened to strangle the economy of the West African country.
The accord between leaders of a March 22 coup and regional mediators came the day Tuareg rebels declared the independence of the northern half of Mali they seized in a lightning advance earlier this week - a secession bid shunned by the world.
The exit of the junta has been a precondition for countries of the 15-state West African bloc ECOWAS to step in to help resolve a crisis in what had been one of the region's most stable democracies, possibly by the use of military force.
"The parliament speaker is appointed by the Constitutional Court as interim president," read the five-page document signed by the mediators and Captain Amadou Sanogo, the hitherto obscure officer behind last month's coup.
"With the signing of this accord, the current president of ECOWAS will take the necessary steps to lift the sanctions imposed on Mali," it said of a crippling border closure, the suspension of its account at the regional central bank, and travel bans and asset freezes on junta members.
The accord did not say when Sanogo would step down to allow the swearing-in of parliament speaker Diouncounda Traore and acknowledged that holding elections within the 40 days set out by the constitution would be impossible in the circumstances.
"It will be necessary to organise a political transition leading to free, democratic and transparent elections across the whole of the territory," it said. The only reference in the document to ousted President Amadou Toumani Touri, who is still in hiding, was that he would officially resign.
When an election will be possible is hard to say after desert Tuaregs earlier proclaimed independence for what they call the state of Azawad, the northern zone they seized while the southern capital Bamako was distracted by the coup.
The nomads have nurtured the dream of a Saharan homeland since Mali's independence in 1960 but neighbours fear the creation of a new state could encourage separatists elsewhere.
Moreover, the presence within the rebellion of Islamists with ties to al Qaeda has sparked wider fears of the emergence of a new rogue state threatening global security.
"The Executive Committee of the MNLA calls on the entire international community to immediately recognise, in a spirit of justice and peace, the independent state of Azawad," Billal Ag Acherif, secretary-general of the Tuareg-led MNLA rebel group said on its www.mnlamov.net home page.
The territory claimed as Azawad roughly corresponds to the three northern regions of Mali which make up a zone larger than France. The term is thought to have linguistic links to the dried up Azawagh tributary of the giant Niger river which snakes through West Africa from Guinea to Nigeria.
The statement listed decades of Tuareg grievances over their treatment by governments dominated by black southerners in the distant capital Bamako. It said the group recognised all borders with neighbouring states and pledged to create a democratic state based on the principles of the United Nations charter.
Reuters Television pictures from the northern town of Gao taken hours before the overnight declaration showed MNLA soldiers celebrating in the local governor's residence, decked with an MNLA flag and re-christened "The Palace of Azawad".
However the 54-state African Union rejected the independence call and urged the rest of the world to shun the secession bid. Algerian Prime Minister Ahmed Ouyahia said his country could not accept a break-up of Mali, while neighbouring Mauritania and even fellow Tuaregs in Niger dismissed it.
The U.S. State Department rejected the MNLA independence call and ex-colonial power France said it was now up to Mali's neighbours to see whether talks were possible with the MNLA - a move that could target an autonomy deal short of independence.
"The demands of the northern Tuareg population are old and for too long had not received adequate and necessary responses," French Foreign Ministry spokesman Bernard Valero said, while stressing that any deal should leave Mali's borders intact.
Initial reactions in Bamako were of dismay.
"This is really a bad joke," Toure Alassane, a 42-year-old native of Timbuktu said at a gathering of about 200 northerners protesting the move in the capital.
"It will never work. You don't just declare independence when people don't have food to eat and nothing is functioning in the north," he said. Widespread food shortages caused by the failure of last year's rains have been aggravated by insecurity.
In the northern town of Kidal, one resident said control was not in the hands of the MNLA but of the Ansar Dine Islamist group which wants to impose sharia, Islamic law, across Mali.
"Nothing goes without their say," the resident said.
ECOWAS is preparing a force of up to 3,000 soldiers which could be deployed in Mali with the aim of securing the return to constitutional order and halting any further rebel advance.
French Defence Minister Gerard Longuet put the MNLA's fighting strength at a maximum 3,000, and that of allied Islamists at about one tenth that number. He said France could provide an ECOWAS force with help including transport. (Additional reporting by Ange Aboa in Abidjan; John Irish and Leigh Thomas in Paris; Aaron Maasho in Addis Ababa; Arshad Mohammed in Washington; writing by Mark John; editing by Tim Pearce and Jackie Frank)