Turkish President Tayyip Erdogan said on January 20, 2020 that Somalia had invited Turkey to explore for oil in its seas, a move that would considerably increase Ankara's growing cooperation with the country.
Speaking to reporters on his flight back from a Libya summit in Berlin, Erdogan said Turkey would take steps in line with the Somali invitation, but did not elaborate further. "There is an offer from Somalia. They are saying: 'There is oil in our seas. You are carrying out these operations with Libya, but you can also do them here.' This is very important for us," Erdogan was cited as saying by NTV. "Therefore, there will be steps that we will take in our operations there."
Somalia adopted in January 2020 a new petroleum law to attract foreign investment in the energy sector, and opened up 15 blocks for oil companies that are willing to explore the country’s hydrocarbon potential. Somalia's recent offer to Turkey risks pulling them into direct conflict with neighboring Kenya, as the oil blocks in question are in the disputed maritime zone. The disputed area is approximately 100,000 square kilometers and is thought to contain significant deposits of oil and gas.
Turkey is seeking to expand Turkey's influence beyond the Middle East to Africa in a bid to transform Turkey from a regional power into a sort of neo-Ottoman Empire and Turkey launched a diplomatic offensive toward Africa some two decades ago to promote political, cultural and trade ties with the continent. Ankara seeks to increase its influence in the Horn of Africa to counter Egypt and Gulf rivals like Saudi Arabia and the United Arab Emirates.
Turkey is a key ally and a major donor of the Somali government in efforts to rebuild the country after more than two decades of conflict and famine. Erdogan became the first non-African leader to visit Somalia in nearly 20 years when he traveled there in 2011, as Turkey's prime minister.  In 2017, Turkey opened a military base in Mogadishu to train Somali soldiers.
Turkey has traditionally maintained good relations with the African continent. The Turkish foreign policy towards Africa is not only based on economic and trade objectives but also incorporates a comprehensive approach which includes the development of Africa through technical and project assistance in the fields such as the fight against diseases, agricultural development, irrigation, energy and education and regular flow of humanitarian aid. 
According to official data, Turkish exports to the African continent reached 121 billion dollars in 2019 while its imports hit 58 billion dollars and a Turkey-Africa summit is set to be held in April 2019.
The Harakat al-Shabaab al-Mujahideen, or Al-Shabaab, (Movement of Warrior Youth), is an off-shoot of the former Islamic Courts Union (ICU) of Somalia and the branch of Al Qaeda in the Horn of Africa. Al-Shabaab seeks to overthrow the government in Somalia and to establish an Islamic emirate ruled by a strict version of Shariah law. It regularly targets security forces and officials from within the relatively weak UN- AU backed government. Bystanders are regularly killed or wounded by its indiscriminate bombing attacks. Al-Shabaab opposes the presence of foreign troops and regularly attacks foreign interests and peacekeepers in the region including Turkish targets. Turkish proceeding with oil exploitation from Somalia would expose the Turks to greater risks from Al Shabaab both on the mainland and at sea.
The car bombing at Afgoye (January 2020)
On January 18, 2020, at least four people have been killed and 15 others wounded in a suicide car bomb attack near the town of Afgoye, about 30 kilometers southwest of Mogadishu, the capital of Somalia.
Both Turkish and Somali officials said those injured in the attack included Turkish engineers as well as Somali nationals working on a road in the area. Turkish engineers have been helping with road construction in the country in recent years.
Al-Shabaab claimed responsibility for the attack on their media outlet, Radio Andalus."We are behind the martyrdom of the suicide car bomb in Afgoye. We targeted the Turkish men and the Somali forces with them. There are casualties of death and injuries." said Abdiasis Abu Musab, spokesman for the group.
On Twitter, the Turkish Ministry of National Defense decried the attack. "We curse and condemn in the strongest terms the bomb terror attack which targeted innocent civilians in Somalia," the ministry said.
The attack came hours after the Somali army said it had repelled several attacks carried out by al-Shabaab in Afgoye town. Al-Shabab claimed it had killed four African Union troops and overrun a military base in Afgoye town, but a Somali official said only one Somali soldier was killed in Afgoye attack.
Turkey's military base in Somalia
In September 2017, Turkey opened its largest military base abroad in the Somali capital, massively strengthening its presence in East Africa. More than 10,000 Somali soldiers will be trained by Turkish officers at the base of Mogadishu.
The construction of the training camp began in March 2015, at the cost of $50 million. The training camp occupies 400 hectares in Mogadishu. It houses three military schools, dormitories, and depots. It has the capacity to train more than 1,500 troops at any one time, by Turkish military officers. Turkey has deployed 200 officers and soldiers as trainers and to provide the compound with security. The first batch of Turkish military personnel arrived in Mogadishu in August 2017 to commence the training program for the Somali national army.
Al-Shabaab and Turkey
For al-Shabaab, Turkey is an unwelcome actor, helping the Somali government fight the group. It seems unsurprising, then, that Turkey has become a major enemy.
Al-Shabab has built authority by claiming to be the only "legitimate" Islamic movement in Somalia. Turkey's work there undermines that claim. Turkey's Directorate of Religious Affairs, the Diyanet, has been funding mosque-building projects in a number of countries, including Somalia. Building mosques gives Turkey a platform to promote itself as a legitimate and authentic religious authority. It also gives it an opening to promote Turkey's vision of Islam.
There have been several attacks on Turkish targets and interests in Somalia:
On December 28, 2019, at least 79 people were dead and 149 more injured after a massive car bomb exploded at a busy intersection on the outskirts of Somalia's capital, Mogadishu, on December 28, 2019. It was the deadliest attack since truck exploded in 2017 near a fuel tanker, creating a fireball that killed over 500 people The attacker drove his vehicle into the Ex-Control checkpoint, a tax collection center in Mogadishu. The attack happened during rush hour in the Somali capital and civilians including university students from the Banadir University in Mogadishu and soldiers were among the dead.
Al-Shabaab claimed responsibility for the bomb in Mogadishu. The group’s spokesman Sheikh Ali Mohamud Rage in an audio post on pro-al-Shabaab websites said the bombing targeted a “hostile Turkish convoy” near a busy checkpoint at an entrance to the city. Two Turkish brothers were among the dead.
Turkish President Recep Tayyip Erdogan condemned the attack and on December 29, 2019, 16 people in critical condition were airlifted to Turkey by a Turkish military cargo aircraft to receive further medical treatment. The aircraft also brought 24 doctors specializing in trauma to help treat some 125 people injured in the blast. 
Two Turkish citizens were killed in the blast and according to medical sources, another two who were wounded will be among those airlifted home. Turkey's Foreign Minister Mevlüt Çavuşoğlu confirmed two Turkish citizens died in the attack. The remaining of those 45 were taken to Qatar and neighboring countries for treatment.
On October 4, 2011, a blast in Mogadishu killed more than 70 Somalis, apparently targeted students queuing up to apply for Turkish scholarships. Turkey provided medical care in the wake of this dreadful attack.
In July 2013, a car loaded with explosives rammed into an office housing Turkish embassy staff in Mogadishu, killing three people. Al-Shabaab claimed responsibility for that attack.
On January 22, 2015, three Somali nationals were killed when a suicide car bomber blew himself up at the gate of a hotel housing the advance party of the Turkish President Recep Tayyip Erdogan who visited the country days later. The Turkish delegation of around 70 members was staying at the hotel at the time of the attack but was unharmed. Following the January bombing, the spokesperson for al-Shabab, Sheikh Ali Mohamed Rage, named Turkey as one of its targets. "NATO is the biggest enemy of Muslims and Turkey is a part of it. NATO is a union of Christians. NATO uses Turkey as a hammer to smash Muslims," said Rage.
In January 2015, the Turkish National Police Department warned all the police departments in the country that an al-Shabab member codenamed "Bihaari" may have been assigned to carry out bomb attacks in Turkey. Bihaari was in January 2015 in Syria and had plans to move to Turkey. The police statement also exposed other potential suspects who might participate in terrorist attacks in Turkey.
On January 1, 2016, Al-Shabab gunmen have shot and killed, a Turkish engineer working with Turkish aid agencies in Mogadishu. The engineer was shot and dead by two assailants shortly after he left a local mosque where he performed the Friday Prayers. The attack was claimed by al-Shabab. In a statement published to one of its propaganda websites, the group said its armed men killed one of the "foreigners invaded the country."
On February 8, 2016, a suicide bomber detonated his explosive device on board of a Daallo Airlines plane and forced it to make an emergency landing in Mogadishu. The bomber was sucked out of the plane through the one-meter wide hole when the blast ripped open the pressurized cabin in mid-air. Somali officials released a video of airport workers handling a laptop believed to have concealed an explosive device that was detonated on a passenger plane traveling from Mogadishu to Djibouti. The footage, showed two airport workers handing a laptop to the suspected bomber.
The 74 passengers aboard the flight, including the suicide bomber, have originally checked in with Turkish Airlines. Turkish Airlines canceled its flight from Mogadishu that morning because their incoming flight from Djibouti could not come to Mogadishu due to strong winds. The Turkish Airlines requested Daallo Airlines to carry the passengers on their behalf to Djibouti where they would continue their journey on a Turkish Airlines flight.
Ankara is seeking to expand its influence beyond the Middle East to Africa in a bid to transform Turkey from the regional state into a sort of neo-Ottoman Empire. After concluding an agreement with Qatar to build Turkey's first military base abroad (2015), as a projection of its expanded geopolitical and economic presence in East Africa, Turkey opened its largest overseas military training camp in the Somali capital of Mogadishu in September 2017. Turkey is currently among the countries training and equipping Somali forces amid a security and developmental bilateral agreements with Mogadishu.
The high-profile 2011 visit of President Erdogan gave unprecedented validity to the Turkish efforts and reinforced the popular theory that Turkey is distinctly – and uniquely – a reliable fellow Muslim nation that can create global awareness about Somalia’s plight. Turkey has taken a series of political and humanitarian initiatives to help lift Somalia out of its long-standing crisis. Turkey became a strong and active ally in the Somali issue and was the first major country to offer humanitarian assistance to reduce the impact of drought and famine that struck Somalia.
Turkey has been very active in Somalia since 2011, helping the country strengthen its public institutions and infrastructures and alleviate a severe famine. Turkey constructed the airport road and established two hospitals, schools and other projects. More than 60 tons of food and medical supplies were sent to Mogadishu in April 2017. On August 15, 2017, Turkish Airlines carried more than 60 tons of food aid to Mogadishu, to be distributed to 12 locations in Somalia.
The Somali oil drilling offer might be payback for some of the reconstruction work and humanitarian aid. Turkish proceeding with oil exploitation from Somalia would expose the Turks to greater risks from Al Shabaab both on the mainland and at sea.
As the African Union Mission in Somalia (AMISOM) prepares withdrawal from Somalia, Turkey supports Somalia’s Federal Government to take over its security and build strong and capable forces and assists security forces in Somalia in their fight against the Al-Shabaab militant group.
 Erdogan says Somalia has invited Turkey to explore for oil in its seas: NTV, Ahram online, January 20, 2020.
 Turkey targets Somalia for oil drilling, Arab news, January 23, 2020.
 Africa central to Turkey’s push for new world order, Daily Sabah, August 24, 2018.
 Suicide bomber kills more than 90 people including foreigners in attack on checkpoint in Mogadishu' Mail online, December 29, 2019.
 Shaul Shay, Somalia in Transition, Transaction Publishers, New Brunswick, USA, 2014, pp 197 – 198.
 Somalia: Turkish workers wounded in deadly al-Shabab car bombing, Al Jazeera, January 18, 2020.
 Abdulaziz Osman, car bomb targets turkish engineers outside Mogadishu, VOA, January 18, 2020.
 Omar Nor, Raja Razek and Lauren Said Moorhouse, Somalia suicide car bomb attack rocks capital, killing scores, CNN, December 30, 2019.
 Somalia’s Al-Shabaab extremists claim deadly bombing, the Arab news, December 31, 2019.
 Turkish military plane evacuates Somalia bomb victims, the new Arab, December 31, 2019.
 Omar Nor, Raja Razek and Lauren Said Moorhouse, Somalia suicide car bomb attack rocks capital, killing scores, CNN, December 30, 2019.