In a last-ditch effort to circumvent the court's decision speaker Bulent Arinc arranged a vote in the Turkish parliament on the issue.
But he failed to achieve the two-thirds majority required - for the second time - leading Mr Gul to end his efforts to become the country's head of state.
Turkey's president occupies a hugely symbolic role and many feared that the election of pro-Islamist Mr Gul would compromise the country's strict separation of church and state.
Turkey's prime minister, Tayyip Erdogan, has called general elections to be held on June 22nd to break the political deadlock caused by Mr Gul's candidacy.
He has also called for constitutional changes which would tie the presidential election more closely to the popular vote.
Click here to run an energy price comparison, and see if you could be paying less for your gas and electricity.