On August 8, two political heavyweights will compete for power in a tightly fought presidential election in Kenya. President Uhuru Kenyatta, who came to power in 2013, is seeking a second and final term in office. Raila Odinga, who lost to Kenyatta in the last election, is his main challenger.

The results of the election, the sixth since the end of the one-party state in 1991, are significant not just for Kenya, but also for the wider region. Kenya is a political and economic powerhouse, and a relative bastion of peace in East Africa. Regional leaders will be anxious about the outcome of the election and - in the case of an Odinga administration - about the priorities of the new government.

Over the years, Kenyatta and Odinga have differed widely on important policy issues that affect security and cooperation in the region.

Withdrawing troops from AMISOM

Odinga has taken issue with Kenya's involvement in the African Union Mission in Somalia (AMISOM), a major regional peacekeeping operation in which Kenya plays a central role. He has often called for the withdrawal of Kenya's Defense Forces (KDF), despite being the prime minister of the government that sent Kenyan soldiers to Somalia for the first time. Numbering more than 3,600 and mainly responsible for Sector 2 - a large swath that encompasses the western and southwestern border of Somalia with Kenya - the KDF deployment plays a significant role in the regional effort to dismantle and defeat al-Shabab.

Even though territorially weakened, al-Shabab remains a potent threat for the region; controlling territories in southern and central parts of Somalia that act as a haven for the group to plot attacks. For example, over the past two years, al-Shabab has overrun three of AMISOM's Forward Operating Bases (FOB): KDF FOB in Ceel Adde, Uganda's FOB in Janaale, and Burundi's FOB in Leego - all in South-Central Somalia.

OPINION: Kenya's election - What will young people vote for?

AMISOM has plans to start withdrawing troops from Somalia in October 2018, with a scheduled full withdrawal completed by 2020, yet the AU mission is unlikely to leave if assessments still show that the nascent Somali National Army is incapable of taking control.

Moreover, the mission still requires an extra 28,000 troops to pacify al-Shabab in the south-central regions of Jubaland and Hiiraan. KDF withdrawal under a new Odinga government will severely affect the mission, creating a vacuum that will allow al-Shabab to re-group - endangering not only the progress made inside Somalia but also the security of Kenya and the stability of the wider region. In contrast, Kenyatta has urged regional leaders to deploy more troops and has called on the international community to help with the additional deployments.

If Odinga wins the election, a regional diplomatic crisis may also be on the cards, with Somaliland, a semi-autonomous region that declared independence from Somalia, at centre stage. During a question and answer session at Chatham House last autumn, Odinga voiced support for the region's independence, stating that he was "a strong supporter of the full recognition of Somaliland". As expected, his statement garnered a forceful rebuke from the Somali government.

If an Odinga-led government recognises Somaliland, Kenya would become the first country to do so. Such an action will undoubtedly wreak diplomatic havoc, not only causing Somalia to sever ties with Kenya, but also threatening the African Union, which considers the recognition of Somaliland as the beginning of a domino effect that could cause other distinct groups within the continent to also declare independence.

EAC integration efforts

An Odinga administration could, however, bring some much-needed enthusiasm to the East African Community's (EAC) integration efforts. Tanzania's protectionist policies, which impose both tariff and non-tariff barriers, threaten the free flow of trade within the EAC. Tanzanian President John Magufuli has managed to upstage other regional leaders, including President Kenyatta, and increase the profile of his nation on the global stage. This led to interstate competition between the member states of the EAC and has worked against the goal of advancing the common regional interests. As a result, Kenya's relations with Tanzania have been lukewarm under the Kenyatta administration.

Unfortunately, this year's vote has many of the same tell-tale signs that marked the 2007 post-election violence.

In an effort to de-escalate the ongoing trade war between the two nations, Kenya and Tanzania reached an agreement last week to lift a ban with immediate effect on wheat flour, cigarettes, milk and milk products. However, despite this agreement, Tanzania made a u-turn a few days later and blocked 20 Kenyan companies, including Kenyatta's Brookside Dairies, from accessing the Tanzanian market.

With the trade row now escalating, these recent developments add to an already tense relationship between the two leaders, and there is not much chance of an immediate improvement if Kenyatta wins another term in August.

However, Odinga and Magufuli enjoy a close personal relationship, with Odinga recently being accorded something approaching a state visit by Magufuli. Perhaps with Odinga in office, Kenya's relations with Tanzania will improve and the stalled EAC integration efforts will pick up steam.

However, none of this matters if political violence erupts in Kenya.

The posibility of post-election violence

Kenya has a long history of dealing with political violence: it occurred during the elections of 1992, 1997 and, most notably, in 2007, when Odinga challenged the then incumbent President Mwai Kibaki.

Most polls and early results pointed to a strong lead for Odinga over Kibaki; the days that followed, however, saw Odinga's lead quickly narrow. Three days after the election, in a closed-door meeting, the Electoral Commission of Kenya announced Kibaki as the winner by less than a quarter of a million votes. The announcement triggered widespread protests across the country as Odinga's supporters accused Kibaki of stealing the presidency. The protests quickly turned into the worst violence the country had witnessed since independence - with more than 1,300 killed and 600,000 others displaced from their homes.

READ MORE: Why Kenya's presidential election on August 8 matters

Unfortunately, this year's vote has many of the same tell-tale signs that marked the 2007 post-election violence. These include low public confidence in the Independent Electoral and Boundaries Commission, the appearance of a partisan judiciary, and a tightening race, with most opinion polls putting the two candidates within the margin of error.

Supporters of both sides firmly believe their candidate will win - with many opposition supporters adamant that the only way they can lose is if votes are tampered with. Furthermore, during a recent presidential debate, Odinga said there would be no violence if the elections are conducted in a free and fair manner, adding uncertainty to an already tense situation. After the August 8 vote, if Odinga loses and does not either concede defeat or seek judicial recourse, a repeat of 2007's political violence is a real possibility.

Unrest in Kenya will destabilise a region already facing myriad challenges. South Sudan, the youngest country in the block, is facing a civil war that broke out in 2013 and a catastrophic humanitarian crisis. In Burundi, ongoing political unrest has killed hundreds of people and displaced hundreds of thousands more as the government cracks down on dissent and opposition. In Somalia, al-Shabab continues to wage a war against the newly inaugurated Somali government and poses a security threat to Kenya and other neighbouring countries. If Kenya also succumbs to political violence, regional peace will become a lot harder to achieve.

Economically, the inland EAC members, including Uganda, Rwanda, and South Sudan, will suffer if a repeat of electoral violence occurs, as they rely on Kenya's Mombasa port and the Northern Corridor for imported goods.

Regardless of the electoral outcome, Kenya's policies in the region or its political stability will undergo a tectonic shift and its trajectory will also shape the region.

Yasin Ahmed Ismail leads GLAFPOL, a research, analysis and consultancy group operating in East Africa and the Horn of Africa. Previously, he was an analyst on East Africa at the Center for Advanced Defense Studies (C4ADS) in Washington, DC.

The views expressed in this article are the author's own and do not necessarily reflect Al Jazeera's editorial policy.