Preliminary investigations show a young Somali Canadian peace activist was killed by a stray bullet earlier this week in Mogadishu, the peacekeeping mission in Somalia said Friday, while her family prepared her memorial.

The statement by the African Union mission said Almaas Elman was hit while travelling in a car Wednesday inside a heavily defended base near the international airport where many diplomats and aid workers have offices.

The former diplomat was the latest member of Somalia's diaspora to be killed after returning home to help rebuild the country after decades of conflict, including a Somali-Canadian journalist who died in a bomb blast in July.

Elman's family founded a prominent peace centre in Somalia and her sister Ilwad was reportedly short-listed for this year's Nobel Peace Prize.

In a brief statement Thursday, Ilwad Elman said "we will lay my sister Almaas to rest" at a mosque in Mogadishu during Friday prayers. "Thank you for all of the love."

'Heart-wrenching and unfortunate'

The AU statement said there was no record of a weapon being fired inside the base at the time Almaas Elman was shot and other stray bullets had been reported previously.

It called her death "heart-wrenching and unfortunate."

The sisters fled Somalia with their mother, Fartuun Adan, in the early 1990s as the country's warlord-led chaos deepened after the fall of president Siad Barre.

Their father, Elman Ali Ahmed, stayed behind to run the Elman Peace centre until he was murdered in 1996.

A decade later, Adan returned from Canada to continue the work and the daughters followed. They found Mogadishu in the grip of the al-Qaeda-linked al-Shabaab extremist group, which had formed and spread during their time away.

Peacemaking efforts crucial

Even years after the extremists were chased out of the capital by the AU force, al-Shabaab still carries out bombings against hotels and other high-profile targets in the seaside city. A devastating truck bombing in Mogadishu in 2017 killed well over 500 people.

Only this year has the U.S. Embassy been re-established in Somalia, nearly 30 years after its staffers fled.

Amid the insecurity, Almaas Elman was among a growing number of young Somali professionals returning from the diaspora to help rebuild the country, rural parts of which are still controlled by al-Shabaab.

She had been working with the European Union in Somalia.

"We had been blessed by her energy for the last months. Her memory will be with us," the EU ambassador, Nicolas Berlanga, tweeted.

As Somalia's federal government finds its footing, efforts of peacemakers are crucial.

Tensions between the federal government and regional states continue ahead of a presidential election as early as late next year, and security is a huge concern as the AU force prepares to withdraw and hand over security to ill-prepared Somali forces.

Hussen lauds family

Federal cabinet minister Ahmed Hussen called Elman's death devastating news for many people, including him.

Hussen, a former president of the Canadian Somali Congress, immigrated to Canada in 1993, and after years of civil-society work, including to help women in East Africa access education, got involved in politics.

MP Ahmed Hussen said the Elman family has a long history of demonstrating Canadian generosity in Somalia. (Sean Kilpatrick/Canadian Press)

Speaking after a cabinet meeting Thursday, Hussen said the Elman family has a long history of demonstrating Canadian generosity in Somalia, and expects them to carry on that tradition.

"The Elman family has been amazing ... and finding that news was really difficult for a lot of people, including myself, because I know the contributions that family has made and continues to make in Somalia," Hussen said.