Salva Kiir Mayardit became the first president of Africa's newest country - South Sudan - in 2011, and within two years was presiding over a civil war that has created the largest refugee crisis on the continent and a famine.
Always seen in public with his trademark cowboy hat, the former rebel commander, who specialised in military intelligence, is an accidental politician.
A poor public speaker, he was seen as a moderate within the Sudan People's Liberation Movement (SPLM), and its armed wing the SPLA, during the long fight for independence from northern Sudan.
Observers say this may well have been why he was chosen to assume the leadership of the SPLM in 2005 following the sudden death of its founding leader John Garang in a helicopter crash.
Mr Garang's death was a blow to the SPLM, coming just three months after he had negotiated a peace deal with the Khartoum government to end three decades of conflict.
But he proved to be a deft operator, taking the post of vice-president in Sudan's government and making sure that it upheld the peace accord signed with Mr Garang.
This led to South Sudan achieving independence some seven years later in July 2011, securing Mr Kiir a place in history as its political midwife.
He had always been in the shadow of Mr Garang, but he proved that he was a leader in his own right when he won elections a year before independence by a huge margin, though there were allegations from the opposition of rigging and intimidation.
"Many political analysts and opinion leaders worldwide describe him as the Biblical Joshua who took the mantle of leadership from Moses just as the Israelites were on the verge of entering Canaan and capably established the then fugitives in the Promised Land," the South Sudan government once posted on its website.
An independent South Sudan was Mr Kiir's long cherished dream - far more so than Mr Garang, who favoured greater rights for southerners in a united Sudan.
For Mr Kiir, the choice was always clear - either be a "second-class" citizen in Sudan or a "free person" in your own homeland, as he put in 2005.
Unlike Mr Garang, he is not an intellectual.
More comfortable speaking Juba Arabic than English, Mr Kiir comes over better in person, is able to work a crowd - and is greeted with cheers and popular affection when he speaks at rallies.
A committed Christian, he regularly speaks at the Roman Catholic cathedral in Juba, the capital.
Salva Kiir timeline
- 1960s: First joined southern rebellion
- 1983: Founder member of SPLM
- 1990s: SPLM military leader
- 2005: Southern leader and national vice-president
- 2010: Elected president of the region of Southern Sudan
- 9 July 2011: Becomes president of newly independent South Sudan
- 2013: Accuses his former deputy Riek Machar of staging a coup; civil war begins
- 2015: Signs peace deal that falls apart the following year
- 2018: Meets Mr Machar in Ethiopia in an attempt to end the strife.
Mr Kiir was born in 1951 in north-western South Sudan and first joined the southern rebellion in the late 1960s.
By the time President Jaafar Numeiri made peace with the rebels in 1972, Mr Kiir had become a low-ranking officer. With the accord in place, he joined the Sudanese army.
In 1983 the southern rebellion was renewed and Mr Garang was sent to quell a mutiny by troops in the south - but instead of putting down the mutineers, he joined them.
Mr Kiir then helped Mr Garang to form the SPLM and rose to lead its military wing, which now forms the army of the new state.
'Intolerant of dissent'
He comes from the Dinka community - the largest ethnic group in the south.
Some members of other groups, especially the Nuer, the second most numerous in the south, resent the perceived Dinka dominance.
The two groups sometimes battled each other during the civil war, as well as fighting together against northerners.
Now, the battle appears to be continuing in the post-independence era.
After fighting broke out in Juba, in mid-December 2013, Mr Kiir accused Riek Machar, a prominent Nuer, of attempting to stage a coup.
Mr Machar, who has presidential ambitions and was sacked as South Sudan's vice-president in July 2013, denied this, accusing Mr Kiir of fuelling conflict to cover his own failing in government.
His critics say Mr Kiir has not made the transition from military commander to politician - and remains intolerant of dissent.
For his part, Mr Kiir has accused Mr Machar of being a "prophet of doom", threatening stability in South Sudan.
More on South Sudan:
Either way, it is the biggest challenge to his authority since he became the president of South Sudan.
His supporters are confident that he will emerge victorious, though some analysts say the conflict will probably leave democracy bruised.
A report by the investigative unit called The Sentry, which was co-founded by the US actor George Clooney, accused Mr Kiir, Mr Machar, and top generals of profiteering from the civil war.
It alleged that Mr Kiir's family members reside in luxurious homes outside South Sudan, including homes in one particular upmarket neighbourhood of Nairobi, Kenya.
The government denied the allegations.
"This sort of allegation can only jeopardise the pursuit of peace and stability in my country where mutual distrust and lack of authority are key factors of violence," a government spokesman said in a statement.
'Unfit partner for peace'
The United Nations said the civil war had set off the largest refugee crisis in Africa since the 1994 Rwandan genocide.
Some 2.5 million people have been forced from their homes, and millions more need food aid.
Tens of thousands have been killed and terrible atrocities have been carried out by both sides - often along ethnic lines.
Mass rape has been used as a weapon of war and UN reports have detailed human rights abuses.
President Kiir ordered unrestricted access for aid groups in 2017 when the country declared famine in two counties.
A rapid aid response averted the crisis, but the UN has warned that 150,000 could slip into famine in 2018.
Both sides signed a peace deal in 2015, which saw Mr Machar sworn in as first vice-president in 2016.
But President Kiir dismissed him in the wake of renewed violence and the deal fell apart.
In 2018, the US ambassador to the UN, Nikki Haley, announced that Washington had given up on Mr Kiir, calling him an "unfit partner" in the pursuit of peace.
Under international pressure to end the conflict, both Mr Kiir and Mr Machar met in June 2018 in Ethiopia's capital, Addis Ababa.
Regional leaders have proposed a way forward - a coalition government that would see Mr Machar take up his old position of vice-president while civil society, women and religious groups will be included in government and parliament.
But this may prove the biggest challenge yet for Mr Kiir - working with a man he clearly loathes for the sake of the South Sudanese people.