(Adds quotes, Abdullah arriving)
By Mirwais Harooni and Praveen Menon
KABUL, June 27 (Reuters) - Thousands of angry protesters marched on the Afghan president's palace on Friday in support of candidate Abdullah Abdullah's allegations that mass fraud had been committed during the presidential election by organisers and state officials.
The run-off pitting the former Northern Alliance leader against ex-finance minister Ashraf Ghani on June 14 has fallen into deadlock over Abdullah's decision to drop out last week.
The impasse has revived longstanding ethnic tensions in Afghanistan because Abdullah's base of support is with the Tajiks, the second largest ethnic group, while Ghani is Pashtun, the largest group.
It also comes at a dangerous time, with the Taliban insurgency still raging and most NATO-led forces preparing to leave the country by the end of the year.
Abdullah joined protesters aboard a small truck, driving alongside the crowd and waving a flag.
"Our beloved president is Abdullah Abdullah," shouted supporters, along with additional cries blaming the incumbent, President Hamid Karzai, for the political stand-off. Karzai was constitutionally barred from running for third time.
Abdullah has accused Karzai, provincial governors and police of complicity in efforts to rig the election.
Around 15,000 people joined the protest, according to police and Reuters witnesses. Some demonstrated their outrage by destroying posters of Karzai and shouting angry slogans against the president and the independent election commission.
"We want the mujahideen back. We don't want technocrats and slaves of Jews and Christians," said Badam Gul, a former mujahid.
"We want justice at any cost. There's fraud and that is unacceptable for us. We will fight for our right until the last drop of blood in our body."
The march was largely peaceful and well coordinated by its organisers. Water was distributed to protesters and organisers formed a protective cordon around sensitive locations like the Serena Hotel, where many top Afghan and foreign officials stay.
Adding to the danger for Afghanistan, an agreement with Washington to allow a smaller U.S. military presence after most foreign forces leave remains unsigned, as Karzai had wanted to leave it to his successor.
The top U.N. representative in Afghanistan warned of the risk of "a protracted confrontation with a danger of a slide into violence" in a briefing to the security council on Wednesday and urged Abdullah to return to the electoral process.
Abdullah has appealed to the United Nations to intervene to salvage the election, a solution that Karzai has also backed. (Reporting by Mirwais Harooni and Praveen Menon; Writing by Jessica Donati; Editing by Simon Cameron-Moore and Nick Macfie)