With more than 96% of ballot boxes counted, Erdogan led with 49.44% of votes and Kilicdaroglu had 44.86%, according to state-owned news agency Anadolu.
Yet both sides claimed to be ahead and contested the figures, warning against any premature conclusions in a deeply polarized country which is at a political crossroads.
The vote, seen as a verdict on Erdogan's increasingly authoritarian path, was set to hand his ruling alliance a majority in parliament, giving him a potential edge heading into the May 28 runoff vote.
Opinion polls before the election had pointed to a very tight race but gave Kilicdaroglu, who heads a six-party alliance, a slight lead. Two polls on Friday even showed him above the 50% threshold.
The presidential vote will decide not only who leads Turkey, a NATO-member country of 85 million, but also whether it reverts to a more secular, democratic path; how it will handle its severe cost of living crisis; and manage key relations with Russia, the Middle East and the West.
"Erdogan will have an advantage in a second vote after his alliance did far better than the opposition's alliance. I would expect...lots of currency fluctuation in the next two weeks," said Hakan Akbas, managing director of political advisory Strategic Advisory Services.
A separate vote count published by ANKA showed more than 99% of ballot boxes counted, giving Erdogan 49.26% versus Kilicdaroglu with 45.04%.
Yet the opposition said Erdogan's party was delaying full results from emerging by lodging objections, while authorities were publishing results in an order that artificially boosted Erdogan's tally.
Kilicdaroglu, in his first appearance after midnight, said that Erdogan's party was "destroying the will of Turkey" by objecting to the counts of more than 1,000 ballot boxes. "You cannot prevent what will happen with objections. We will never let this become a fait accompli," he said.
A senior official from the opposition alliance said: "it seems there will be no winner in the first round. But, our data indicates Kilicdaroglu will lead."
Meanwhile, supporters of both sides celebrated.
"We know it is not exactly a celebration yet but we hope we will soon celebrate his victory. Erdogan is the best leader we had for this country and we love him," said Yalcin Yildrim, 39, who owns a textile factory.
He said Erdogan raised Turkey's profile on the world stage.
Feyyaz Balcu, 23, a cyber security engineer said: "We accept that the economy is not in good shape now but Erdogan will make it better."
At Kilicdaroglu's CHP party headquarters supporterswaved flags of Turkey's founder Mustafa Kemal Ataturk and beat drums.
MAY 28 RUNOFF
The choice of Turkey's next president is one of the most consequential political decisions in the country's 100-year history and will reverberate well beyond Turkey's borders.
A defeat for Erdogan, one of President Vladimir Putin's most important allies, will likely unnerve the Kremlin but comfort the Biden administration, as well as many European and Middle Eastern leaders who had troubled relations with Erdogan.
Asked if he had any comment on the Turkish election and told by a reporter that there appeared to be a dispute between the two sides about initial results, U.S. President Joe Biden said: "Sounds familiar, doesn't it?"
Turkey's longest-serving leader has turned the NATO member and Europe's second largest country into a global player, modernized it through megaprojects such as new bridges and airports, and built an arms industry sought by foreign states.
But his volatile economic policy of low interest rates, which set off a spiralling cost of living crisis and inflation, left him prey to voters' anger. His government's slow response to a devastating earthquake in southeast Turkey that killed 50,000 people added to voters' dismay.
Kilicdaroglu has pledged to reviving democracy after years of state repression, returning to orthodox economic policies, empowering institutions who lost autonomy under Erdogan's tight grasp and rebuilding frail ties with the West.
Thousands of political prisoners and activists could be released if the opposition prevails.
Critics fear Erdogan will govern ever more autocratically if he wins another term. The 69-year-old president, a veteran of a dozen election victories, says he respects democracy.
A third nationalist presidential candidate, Sinan Ogan, stood at 5.3% of the vote. Who he decides to endorse in the next round could be critical.
PARLIAMENTARY RESULTS
Turks also voted for a new parliament. The People's Alliance comprising Erdogan's Islamist-rooted AKP and the nationalist MHP and others appeared to have fared better than expected and be headed for a majority.
With 93% of votes counted, Erdogan's alliance looked on course for 324 seats in the 600-seat parliament. Kilicdaroglu's Nation Alliance formed of six opposition parties, including his secularist Republican People's Party (CHP) established by Ataturk, looked set for 211 seats.
The Labour and Freedom alliance, led by the pro-Kurdish Green Left party, appeared headed for 65 seats.