By Souleymane Ag Anara

GAO, Mali (Reuters) - Malian soldiers staged their first joint patrol on Thursday with rival armed groups in the town of Gao, where Islamist militants killed over 77 people last month in the deadliest such attack in the country's history.

The long-awaited patrol is part of an initiative aimed at easing local tensions so that government forces can focus on fighting the militants. More such patrols are due over the next few weeks under the terms of a 2015 U.N.-brokered peace deal.

Hundreds of soldiers from Mali's army, France's operation Barkhane, the U.N. peacekeeping mission, the Tuareg separatist Coordination of Azawad Movements and pro-government militias took part in the patrol, a Reuters witness said.

They moved through the town on foot and in pick-up trucks, starting at around 9.45 a.m. local time (4.45 a.m. ET) on a roughly 7-km (4-mile) route and met no resistance, the witness said.

"The patrol ... allows us to make sure the situation is calm so that people can get along. Without patrols people will not mingle but the patrols help people feel more confident," said Malian sergeant Alhousseyni Ag Sid, who sat in a pick-up truck.

The Jan. 18 attack in Gao claimed by al Qaeda in the Islamic Maghreb shows the difficulty faced by the government and international peacekeepers in combating militant Islamist groups, some with links to al Qaeda, based in the desert north.

Gao is a town of 50,000 people on the banks of the Niger river, where the offices of the 13,000-strong U.N. mission in Mali, MINUSMA, were flattened by a truck bomb in December.

   A French-led military intervention in 2013 pushed insurgent groups back from northern Mali - a vast desert area they had taken the year before - but Islamist militants still conduct frequent attacks there.

(Writing by Matthew Mpoke Bigg; Editing by Tom Heneghan)