Mohammad Nadir Naim said he was withdrawing for the sake of national unity and throwing his support behind former Foreign Minister Zalmai Rassoul.
Naim, grandson of Afghanistan's King Zahir Shah who died in 2007, spent most of his life in exile and was never considered a strong candidate in the race.
He was the third candidate to drop out, leaving eight contenders to succeed President Hamid Karzai, who is not running for the first time since the US-led invasion that ousted the Taliban. Karzai is constitutionally banned from seeking a third term.
Afghan authorities are under pressure to prevent fraud from discrediting the credibility of the upcoming vote for a new president and provincial councils. There were widespread allegations of ballot stuffing and vote rigging five years ago.
The new leader will guide the country after international combat troops withdraw by the end of this year, leaving the country's security to the Afghan government. Karzai has refused to sign a security agreement with the United States that would allow thousands of foreign forces to stay in the country in a largely training and advisory role.
"I'm confident that ... Each of them, should he become president, will sign the agreement as a first order of business," Ambassador James Cunningham told reporters at a briefing at the embassy in Kabul. "No one has hinted and nor would we agree to renegotiate the agreement."
"We've accepted the likelihood that President Karzai is not going to sign the agreement," Cunningham said. He also said he was hopeful a recent spike in violence, including deadly attacks on an Afghan election office and a luxury hotel frequented by Westerners, would not derail the vote.
