By Nick Tattersall and Humeyra Pamuk

ISTANBUL (Reuters) - Much like the vast mosque he has commissioned atop one of Istanbul's highest hills, President Tayyip Erdogan's supporters hope a referendum on Sunday will be a crowning achievement in his drive to reshape Turkey.

The vote, in which millions of Turks will decide whether to replace their parliamentary democracy with an all-powerful presidency, may bring the biggest change in their system of governance since the modern Turkish republic was founded on the ashes of the Ottoman Empire almost a century ago.

The outcome will have repercussions beyond Turkish shores.

(Graphic - Turkey's referendum: a simple vote but a close race: http://tmsnrt.rs/2pyhiFR)

Never in recent times has Turkey, one of only two Muslim members of the NATO military alliance, been so central to world affairs, from the fight against Islamic State in Syria and Iraq, to Europe's migrant crisis and Ankara's shifting allegiances with Moscow and Washington.

The campaign has split the country of 80 million down the middle, its divisions spilling over to the large Turkish diaspora in Europe. Erdogan has accused European leaders of acting like Nazis for banning rallies on security grounds, while his opponents overseas say they have been spied on.

Erdogan's fervent supporters see his drive for greater powers as the just reward for a leader who has put Islamist values back at the core of public life, championed the pious working classes and delivered airports, hospitals and schools.

Opponents fear a lurch toward authoritarianism under a president they see as addicted to power and intolerant of dissent, chipping away at the secular foundations laid by modern Turkey's founder, Mustafa Kemal Ataturk, and taking it ever further from Western values on democracy and free speech.

"Within the past 15 years he has achieved everything once considered impossible, unthinkable for Turks, be it bridges, undersea tunnels, roads, airports," said Ergin Kulunk, 65, a civil engineer who heads an Istanbul mosque association that is financing the new mosque on the city's Camlica Hill.

Story continues

"The biggest quality of the Chief is that he touches people. I saw him at a recent gathering literally shaking almost 1,000 hands. He's not doing that for politics. It comes from the heart," he said, as Erdogan's voice boomed from a television in the corner, broadcasting one of his daily campaign rallies.

In Kulunk's office on Camlica Hill, once a hunting ground for the Ottoman well-to-do and now a popular viewing point, a signed picture of Erdogan hung on the wall next to portraits of Ataturk and Ottoman Sultan Abdulhamid.

But for Erdogan's opponents - including secularist liberals, left-leaning Kurds and even some nationalists - his tightening grip poses an almost existential threat.

"He's trying to destroy the republic and the legacy of Ataturk," said Nurten Kayacan, 61, a housewife from the Aegean coastal city of Izmir, attending a small "No" rally at an Istanbul ferry port.

"If the 'Yes' vote wins, we're headed to chaos. He will be the president of only half of the country," she said.

"ONE-MAN SYSTEM"

Erdogan assumed the presidency, then a largely ceremonial position, in 2014 after more than a decade as prime minister, and has since continued to dominate politics by force of personality, making no secret of his ambition for greater powers.

He has ridden a wave of patriotism since an abortive coup in July, casting Turkey as at peril from a cocktail of outside forces and in need of strong leadership to see off threats from Islamic State, Kurdish militants, the enemies within who tried to oust him and their foreign backers.

A poll two weeks after the attempted putsch showed him with two-thirds approval, his highest ever, but more recent surveys suggest a much closer race. A narrow majority of Turks will vote "Yes", two opinion polls suggested on Thursday, putting his support at only a little over 51 percent.

Pollsters acknowledge there may be a hidden "No" vote, whose numbers are hard to assess, among traditional supporters of the ruling AK Party concerned about Erdogan's authoritarian instincts, particularly after more than 120,000 civil servants were sacked or suspended since the failed coup.

Etyen Mahcupyan, a one-time chief adviser to former Prime Minister Ahmet Davutoglu, a key figure in the AKP, wrote in the Karar newspaper on Thursday that he would be voting "No".

"The (proposed) model will cause great harm in the medium term to conservatives and Turkey," he wrote, saying the changes would usher in a "one-man system" open to abuse. "Every AKP member must vigorously stand up for the protection of the party and for its capacity and potential to govern."

Erdogan's supporters reject such charges, saying the 18 constitutional amendments being put to a simple "Yes/No" vote contain sufficient checks and balances, such as the provision that a new presidential election would be triggered should the president dissolve parliament.

Erdogan has focused in recent campaign events on trying to ridicule the leader of the main secularist CHP opposition, Kemal Kilicdaroglu, playing videos of his gaffes in the apparent hope that voter patterns will reflect the last national election in November 2015, when AKP dominated the electoral map.

Such populist tactics have won him boisterous applause from those who revere him. But he has spent less time on the details of the proposed constitutional reforms.

"Eighty percent of voters in Turkey vote according to ideology. That is, they will cast their votes in this referendum without knowing its content," said Murat Gezici, head of the Gezici polling company.

"If 'Yes' emerges victorious, they'll only find out what they said yes to by experience. Only then will they face the problems," he said in his Istanbul office.

(Additional reporting by Umit Bektas, Melih Aslan and Daren Butler; Writing by Nick Tattersall; Editing by Andrew Heavens)