On June 26, 1960, four days before granting British Somaliland independence, the British government declared that all Somali-inhabited areas of East Africa should be unified in one administrative region. However, after the dissolution of the former British colonies in the region, Britain granted administration of the Northern Frontier District to Kenyan nationalists despite an informal plebiscite demonstrating the overwhelming desire of the region's population to join the newly formed Somali Republic. On the eve of Kenyan independence in August 1963, British officials belatedly realized that the new Kenyan administration was not willing to give up the Somali-inhabited areas it had just been granted administration of. Led by the Northern Province People's Progressive Party, Somalis in the NFD vigorously sought union with their kin in the Somali Republic to the north. In response, the Kenyan government enacted a number of repressive measures designed to frustrate their efforts in what came to be known as the Shifta War. Although the conflict ended in a cease-fire, Somalis in the region still identify and maintain close ties with their kin in Somalia, and see themselves as one people. Somalis in Kenya have historically inhabited the Northern Frontier District, which was later renamed the North Eastern Province. The NFD came into being in 1925, when it was carved out of the Jubaland region in present-day southern Somalia. At the time under British colonial administration, the northern half of Jubaland was ceded to Italy as a reward for the Italians' support of the Allies during World War I. Britain retained control of the southern half of the territory, which was later called the Northern Frontier District. From the 2010s onwards, during the administration of Ahmed Madobe, ties between Kenya and Jubaland have deepened, particularly in the form of economic and military cooperation.
In August 2014, the Federal Government of Somalia formally asked the International Court of Justice "to determine, on the basis of international law, the complete course of the single maritime boundary dividing all the maritime areas appertaining to Somalia and to Kenya in the Indian Ocean." In February 2019, Kenya summoned its ambassador to Somalia back home and asked his Somalia counterpart Mohammed Muhamud Nur to return to Mogadishu for consultation with his government after the Somali government’s decision to auction oil and gas exploration blocks at the center of the two countries' maritime territorial dispute in the Indian Ocean. In July 2019, Somalia lodged a protest to the Kenyan government for referring to the self-proclaimed Somaliland as a country.
In October 2011, a coordinated operation between the Somali military and the Kenyan military, Operation Linda Nchi, began against the Al-Shabaab group of insurgents in southern Somalia. The mission was officially led by the Somali army, with the Kenyan forces providing a support role. In early June 2012, Kenyan troops were formally integrated into AMISOM. By September 2012, the Somali National Army and allied Kenyan African Union forces and Raskamboni militia had managed to capture Al-Shabaab's last major stronghold, the southern port of Kismayo, during the Battle of Kismayo.