KABUL (Reuters) - Afghan President Ashraf Ghani’s main challenger in a election next month has said he is ready to abandon his bid for power for the sake of peace, raising more questions about prospects for an election the Taliban have vowed to block.

FILE PHOTO: Afghanistan's Chief Executive Abdullah Abdullah speaks at the India-Afghanistan international trade and investment show, in Mumbai, India, September 12, 2018. REUTERS/Francis Mascarenhas/File Photo

The twice-delayed presidential election comes as the United States and the Taliban are trying to seal an agreement under which U.S. forces will withdraw in exchange for a Taliban security guarantee and a promise of power-sharing talks with Ghani’s government.

The Taliban have denounced the election as a sham and vowed to attack rallies. Ghani is insisting an election he looks set to win should go ahead.

Ghani’s main challenger, Chief Executive Abdullah Abdullah, told a campaign rally on Wednesday he would drop out of the race if that could help secure peace.

“My team is ready to quit elections for the sake of peace,” Abdullah said, according to his office.

The Taliban want the election canceled as a condition for so-called intra-Afghan dialogue - talks after the agreement with the United States is struck on how power can be shared and the country organized - and a ceasefire.

Abdullah, a former foreign minister, was Ghani’s main challenger in the last election, in 2014.

That vote was marred by extensive fraud and Ghani became president after U.S. Secretary of State John Kerry brokered a deal creating the post of chief executive for Abdullah.

Ghani has rejected a suggestion put forward by Western allies to postpone the election and form an interim government, perhaps with Taliban representative, after the militants strike their deal with the United States.

Ghani has said the people must be allowed to choose their leader and peace can only be secured under a democratic system.

But the departure of his main challenger could undermine the legitimacy of the election.

BOYCOTT?

This month, another main contender, Hanif Atmar, a former interior minister who also served as Ghani’s national security adviser, suspended his campaign, citing the level of violence in the country.

The campaign opened in July with an insurgent attack on the Kabul office of Ghani’s running mate, Amrullah Saleh. At least 20 people were killed and 50 wounded.

“With Atmar out of the race and Abdullah now giving preference to the peace deal instead of elections, it is quite clear that Ghani will have to realign his stance,” said a Western diplomat in Kabul.

Opposition party sources said many of the 17 candidates in the race were considering a boycott because they believed Ghani was using state apparatus to help him win.

With both the Taliban and U.S. negotiators reporting progress in their talks in recent weeks, and raising the prospect of an end to the 18-year war, the election has yet to capture much attention from the public.

The U.S. special representative for peace in Afghanistan, Zalmay Khalilzad, who has been leading the talks with the Taliban since last year, is scheduled to travel from Doha to Kabul this week for a meeting with Ghani.

Two sources with knowledge of the talks, said the United States will press Ghani to agree to postpone the election.