Afghanistan President Ashraf Ghani on Sunday entered the 2019 presidential race after forging an alliance with a staunch critic to challenge his former governing partners at a time when the Taliban has shut him out of talks to end more than 17 years of war.

Ghani, 69, is seeking a second term amid the war with hard line militants and ongoing peace talks between the United States and the Taliban, in which his government complains it has been side-lined.

On Sunday Ghani registered as a presidential candidate for the July election, facing competition from his one-time officials who have formed new alliances.

Independent analysts said Afghanistan’s political landscape has been thrown into turmoil by the nominations and shifting loyalties.

A day earlier former warlord Gulbuddin Hekmatyar announced he was running for president, with the Afghanistan Chief Executive Abdullah Abdullah, who currently holds a power-sharing agreement with Ghani, formally entering the race on Sunday morning.

In a televised announcement, President Ghani, accompanied by his wife and political allies, listed his National Unity government’s achievements during the five-year term, including his consistent offer to hold unconditional peace talks with the Taliban.

“I started the peace initiative and our team will bring stable and long-lasting peace to the country,” he said, adding that if the Taliban consider themselves Afghans they “should come and talk to us”.

Ghani’s critics say the previous presidential election in 2014 was fraught with irregularities, but the American government backed the Western-educated leader to rule the country while Washington wound down the US military presence in favor of an advisory role to Afghan forces in the war.