(CNN) -- Two key rebel movements in Mali have agreed to join forces, saying together they will rule an independent Islamic state.
The Tuareg group MNLA and the Islamist group Ansar Dine occupying northern Mali reached the deal after a series of talks, according to both groups.
"The Ansar Dine movement and the National Movement for the Liberation of Azawad, MNLA, have proclaimed an independent state, Azawad," MNLA Col. Abdou Haidara announced.
Gunfire was heard in two major towns in the region -- Gao and Timbuktu -- as militants celebrated their decision to form a body to oversee Azawad. Several weeks ago, rebels declared independence for the region, the cradle of their nomadic civilization.
"It's time for its independence," said Moussa Ag Assarid, spokesperson for MNLA.
But not everyone celebrated the news Sunday.
The government in the capital, Bamako immediately rejected the new state.
And some who come from the region occupied by rebels said the separatist and Islamist movements do not have the people's support.
The rebels reached their agreement in Gao, a town in the north where leaders have been meeting.
Hassan Ag Mohamad, a former Ansar Dine official, said the two groups are now one. "Before we were Ansar Dine and MNLA. Now it's all the same."
As gunfire rang out Saturday evening, people afraid of clashes between the two movements immediately returned to their homes.
"I was very afraid when they started shooting, and it was only later I realized the militants were celebrating," said Gao resident Haraji Baber.
An hour later came reports of shooting from Timbuktu, one of the three major towns in what the rebels call Azawad.
The agreement between the secular Tuareg and the Islamists comes after weeks of sometimes heated discussions between two movements, separated both in their objectives and ideologies. While the MNLA is fighting for an independent Azawad, Ansar Dine's main objective is to impose Sharia law in all of Mali.
In the besieged towns, drinking, smoking, listening to music, watching soccer on TV and playing video games have been banned in what now seems to be a preparation for the creation of an Islamic state.
"We are all in favor of the independence of Azawad. We accept Islam as the religion but other religious views will be accepted," said MNLA's Haidara.
"In Azawad 99% are Muslim. Therefore the religion is Islam," Assarid said.
The U.S. government's CIA World Factbook says Mali's population is 90% Muslim, and 1% Christian, while 9% hold "indigenous beliefs." It does not give a religious breakdown for just the northern section.
"People are very happy, they have waited a long time for this," said Mohamad.
Some former officials in the region disagreed.
"Nobody in Gao can accept this convention. I can't accept it," said Sadou Diallo, the mayor of Gao.
Since MNLA took his town, the mayor is a refugee in Bamako.
"This declaration marks a major turning point for northern Mali. Since the March coup, the area has slipped out of the government's control. Now there's no turning back. People have no choice but to accept the rebels and the Islamist decision. They have no way of defending themselves. I believe Gao is lost."
Diallo added that he is very disappointed by the government's inability to free the region from occupiers.
All neighboring countries and international bodies have previously denounced the rebels' call for independence.
"We reiterate our support for the territorial integrity of Mali," U.S. State Department spokesman Mark Toner said last month. "We stand by the African Union, France, and others in their statements rejecting the MNLA's announcement and calling for the unwavering commitment to the national unity of Mali. A separate Azawad state will only exacerbate the grave problems challenging the Malian state. We also call on the MNLA to cease all military operations."
But Assarid said rebels plan to see recognition. "Next week I expect more people to recognize Azawad, which does exist without the recognition of the Bamako government and ECOWAS," the Economic Community Of West African States.
On Saturday the prime minister and leader of Mali's transitional government, Cheick Modibo Diarra, arrived in Abidjan for talks with ECOWAS head Alassane Ouattara, the president of Ivory Coast.
In January, the Tuareg rebels launched an offensive against the Malian army. The fight intensified with the arrival of Ansar Dine and al Qaeda in the Islamic Maghreb (AQIM).
On March 22, Capt. Amadou Haya Sanogo and a group of low-ranking officers ousted the government in Bamako, saying it was incompetent in handling the Tuareg rebellion.
The coup and power vacuum which followed enabled the Tuaregs, Ansar Dine, led by Iyad Ag Ghaly, and backed by AQIM and criminal groups, to occupy the vast north of Mali, an area larger than France.
Together, they pushed back the army. On April 6, in a statement posted on its website, the MNLA declared the independence of Azawad.
The new agreement between the MNLA and Ansar Dine leaves AQIM's position unclear.
"AQIM left Gao this morning. They are not a problem anymore," said MNLA's Haidara. The information could not be confirmed immediately.
The declaration of the Republic of Azawad adds to the long list of issues to be solved by the transitional government in Bamako and ECOWAS.
Mali's interim president Dioncounda Traore is in France for medical treatment after the 70-year-old was assaulted by protesters in his office in the presidential palace on Monday. He is expected to return to Bamako next week.
Traore was appointed in April to lead the long-term transition after ECOWAS mediators managed to form a deal with coup leader Sanogo, stating he will step aside with all the benefits of a former head of state and allow the leaders in Bamako to prepare for elections, as well as find a solution for the north.