A second round is set for August 24.
Gul's ruling Justice and Development (AK) party did not have the two-thirds majority necessary to confirm him as president in the first round of voting. But Gul is widely expected to become president at a later parliamentary vote.
Prime Minister Recep Tayyip Erdogan nominated Gul for the presidency once before, in April of this year. But that attempt ended in spectacular failure, with massive street demonstrations by secularists who opposed seeing a former Islamist politician as president, and a threat from the Turkish army to intervene.
Then followed last month's elections, in which the Islamic-rooted AK party was swept back into power with a wide margin, seen as a political defeat for the army and the secularist elite.
Secularist Fears Remain
The determined Gul quashed the opposition's hopes that he might step aside in favor of a compromise AK candidate, one less associated in the past with political Islam. He has insisted on running again.
Parliament today voted on three candidates: Gul; Sebahattin Cakmakoglu, a former defense minister, nominated by the rightist Nationalist Action Party (MHP); and Tayfun Icli, of the small Democratic Left Party (DSP).
Amberin Zaman, the Turkey correspondent for "The Economist," told RFE/RL that the required two-thirds majority was impossible for Gul to achieve without opposition backing.
Likewise, the other two candidates stood no chance without AK support. The second vote requires the same two-thirds majority.
But Zaman says Gul should win on the third ballot, when he will need only a simple majority. With 341 members of the 550-seat parliament belonging to the AK party, Gul will have the backing he needs.
Gul has pledged to uphold Turkey's secular principles, and to be a president for all Turks. But that has not convinced the secularists, who fear that the devout Gul could work hand-in-hand with Prime Minister Recep Tayyip Erdogan -- another old Islamist -- to gradually weaken modern Turkey's secular state.
Analyst Zaman says that although the army has not issued any more threats to intervene, this does not mean that it now accepts a Gul presidency. Although the military is no longer talking about direct intervention, it may still take symbolic action, such as boycotting presidential ceremonies or scaling down the presence of the military corps within the presidential compound. Such moves would still create political tension, Zalman said.
However, Gul can answer his critics by reference to his record as foreign minister, which illustrates his commitment to continuing Turkish modernization. "His record so far indicates that he is just as good a foreign minister as any secularist in the past -- in fact I would say a much better one," Zalman said.
In particular, Gul stands out for his work in steering Ankara's engagement with the European Union, which has resulted in direct talks on membership for the first time since Turkey filed its original application for membership back in the 1960s.