Black-robed Islamic extremists armed with AK-47 automatic rifles invaded Gao in wooden boats Sunday to launch a surprise attack on the most populous city in northern Mali, two weeks after French and Malian troops ousted the jihadists.

Gunfire echoed for hours across the city of mud-walled buildings. After night fell, the sound of gunfire was replaced by the clattering of French military helicopters overhead.

The attack in Gao could foreshadow a protracted campaign by France and other nations to restore government control in this vast Saharan nation in northwestern Africa.

The Islamic radicals fought against the Malian army throughout the afternoon and were seen roaming the narrow streets blanketed in sand and on rooftops in the center of Gao, which had a population of 90,000 before the conflict caused thousands to flee.

Families hid in their homes. One family handed plastic cups of water through the locked iron gate to others hiding on their patio. Piles of onions lay unattended where market women fled when the Islamists arrived. There were no signs of civilian casualties.

Ever since French forces took Gao on Jan. 26, the Islamic rebels had clashed with security forces on the city's outskirts. This was the first time they succeeded in entering the strategic city.

The Islamic fighters used pirogues, large wooden dugouts with motors, and other boats to cross the Niger River and penetrate Gao, according to French Gen. Bernard Barrera, who cited Malian officials.

Besides Gao, French and Malian forces have also retaken the fabled city of Timbuktu and other northern towns, pushing the Islamic extremists back into the desert. From their hideouts, they are expected to continue challenging French, Malian and allied forces.

The armed Islamic fighters seized the northern half of Mali in April 2012. France launched its military intervention in its former colony on Jan. 11 when the radicals threatened the capital, Bamako.