After more than 20 years of conflict, there are signs of hope in the Somali capital, Mogadishu. Islamist militia al-Shabab was last year largely driven out of the city by African Union forces and Somali government troops. Mogadishu is no longer a divided city and, although the security situation remains precarious, people are starting to rebuild their shattered homes, shops, offices and government buildings. Text and photos: BBC's Mary Harper

Mogadishu's district of Hodan was badly damaged by the waves of violence that hit the city. It was one of the main frontlines of fighting between al-Shabab and government troops backed by African Union forces. This shattered building is now being repaired.

It is boom time for brick makers. With so much reconstruction going on, businesses making concrete bricks are springing up in many parts of town. Some workers say they can hardly keep up with demand.

But the challenge is enormous. Many buildings have been reduced to virtual skeletons. This former post office in Hodan is now home to displaced families and their goats.

Some buildings are beyond repair. The former parliament remains a pile of rubble in the heart of the city.

Freshly painted shops, like this one in Hodan, are opening throughout Mogadishu. Many Somalis are dynamic entrepreneurs, and are prepared to invest in new businesses while gunshots continue to ring out in the city. Grenade attacks, suicide bombings and other forms of violence are still regular occurrences.

Crowds of people flock to shop in Bakara market, the city's vast, sprawling commercial district. It was until last year a stronghold of al-Shabab and a major source of revenue for the movement. Local officials say elements of al-Shabab remain in Bakara, carrying out occasional attacks.

Different products are sold in different parts of Bakara market. A large area is dedicated to suitcases. Hundreds of thousands of Somalis live as refugees outside the country, but many are flooding back to visit or stay permanently in what they say is the new Mogadishu.

Imported footwear is sold in shoe alley. Stalls piled high with shoes attract many customers, and trade is brisk. Local officials say that every day millions of dollars worth of business is done in Bakara.

Fresh fruit and vegetables are sold in another part of the market, near the meat stalls. It is grown locally in the Afgoye district - another area recently taken from al-Shabab, 30 kilometres south of the capital.

Fuel is transported and sold in plastic jerry cans. There are no petrol stations in Mogadishu so people have to fill their vehicles by siphoning fuel from the plastic containers.

Although a few banks have opened in Mogadishu, many people keep their assets in cash. These tins, sold in Bakara market, are used to store money in shops, market stalls and people's homes.

Charcoal is for sale deep in Bakara market. US President Barack Obama recently banned the import of charcoal from Somalia. Al-Shabab derives much of its revenue from charcoal exports to the Middle East.