A retired civil servant who few outside Turkey have heard of has pushed President Recep Tayyip Erdogan into an election runoff — the first of the country’s post-Ottoman history.

It was a bittersweet result that left Kemal Kilicdaroglu’s supporters frustrated following a heated night of vote counting in Turkey’s most important election of modern times.

Nearly complete results showed Erdogan picking up 49 percent of the ballot and the secular opposition leader collecting around 45 percent.

Pre-election polls had shown Kilicdaroglu within a whisker of breaking the 50-percent threshold needed for outright victory.

The lira fell against the euro on investor disappointment that Erdogan’s era of unconventional economics was not coming to an immediate end.

But it still marked a historic achievement for the 74-year-old leader of the strongest opposition alliance to face the man who has never lost a national vote over his two-decade rule.

Kilicdaroglu claimed his own party’s tallies showed that he was leading and urged supporters to guard ballot boxes while the last votes were being counted.

“Don’t be afraid of the nation’s will,” he told Turkey’s election officials early Monday.

The runoff on May 28 will present Kilicdaroglu with a chance to reverse a dire electoral record that has seen him lose his 2009 bid to become mayor of Istanbul and then half a dozen national votes to Erdogan and his Islamic-rooted party.

That record nearly broke the six-party opposition alliance when he announced his intention to challenge Erdogan.

The anti-Erdogan coalition agreed to back his candidacy after arguing about it for a year. They rallied around him after the first-round result.

“We are winning,” Kilicdaroglu’s nationalist ally Meral Aksener tweeted as the outcome became clear.

No ambitions

The soft-spoken Kilicdaroglu is a study of contrasts to the brash and bombastic Erdogan — a populist whose gift for campaigning has helped him become Turkey’s longest-serving leader.

His silver mane and square glasses give Kilicdaroglu a professorial air that betrays his background as an accountant who worked his way up to head Turkey’s social security agency.

The campaign has seen him ignore Erdogan’s personal attacks and instead highlight the hardships all Turks have suffered over years of political and economic turmoil.

One of his main pledges involves handing many of the powers Erdogan has amassed in the last decade of his rule to parliament.

He then promises to leave office and make way for a younger generation of leaders who have joined his multi-faceted team.

“I’m not someone with ambitions,” he said ahead of the vote.

His dream was to “restore democracy” and then “sit in a corner, playing with my grandchildren”.

Kitchen chats

Kilicdaroglu’s support has been helped in no small part by a cost-of-living crisis that analysts — and plenty of Turkish voters — pin on Erdogan’s unorthodox economic beliefs.

But it is backed up by a viral social media campaign that bypasses the state’s stranglehold on television by speaking to voters in snappy clips recorded from his retro-tiled kitchen.

These heart-to-heart chats get millions of views and tend to address topics that rarely appear in pro-government media.

One of the most famous saw Kilicdaroglu break taboos by talking about being Alevi.

The group has been targeted by decades of violent repressions because it follows a more spiritual Islamic tradition that separates it from both Sunni and Shiite Muslims.

Erdogan once accused Alevis of inventing a “new religion”.

“God gave me my life,” Kilicdaroglu said in the video. “I am not sinful.”

The late-night post racked up nearly 50 million views on Twitter by the following morning.

Steely edge

Some of his other policies have a steelier edge that evoke the nationalism of Turkey’s founder Mustafa Kemal Ataturk — the first and most important leader of his Republican People’s Party (CHP).

Kilicdaroglu vows to send nearly four million Syrians who fled civil war back to their homeland within two years.

He said the issue was not one of “race” but of “resources” in Turkey during its economic malaise.

Kilicdaroglu reaffirms that message by recalling his own humble upbringing in the Kurdish Alevi province of Tunceli.

“We didn’t have a fridge, washing machine or dishwasher,” he once said.

He later invited reporters to his pitch-black apartment to discuss his decision to stop paying his electricity bills.

It was a campaign-savvy statement of solidarity with Turkey’s inflation-hit voters that tried to bridge political divides.

“This is my struggle to claim your rights,” he said next to an old-fashioned lantern casting a glow across his desk.