By Tuvan Gumrukcu

ANKARA (Reuters) - Turks vote in a hotly contested referendum on Sunday that could place sweeping new powers in the hands of President Tayyip Erdogan and herald the most radical change to the country's political system in its modern history.

Opinion polls have given a narrow lead for a "Yes" vote, which would replace Turkey's parliamentary democracy with an all-powerful presidency and may see Erdogan in office until at least 2029.

The outcome will also shape Turkey's strained relations with the European Union. The NATO member state has curbed the flow of migrants - mainly refugees from wars in Syria and Iraq - into the bloc but Erdogan says he may review the deal after the vote.

Some 55 million people are eligible to vote at 167,140 polling stations across the nation, which open at 7.00 am (0400 GMT) in the east of the country and close at 5 pm (1400 GMT). Turkish voters abroad have already cast their ballots.

The referendum has bitterly divided the nation. Erdogan and his supporters say the changes are needed to amend the current constitution, written by generals following a 1980 military coup, confront the security and political challenges Turkey faces, and avoid the fragile coalition governments of the past.

Opponents say it is a step towards greater authoritarianism in a country where around 40,000 people have been arrested and 120,000 sacked or suspended from their jobs in a crackdown following a failed coup last July, drawing criticism from Turkey's Western allies and rights groups.

Relations between Turkey and Europe hit a low during the referendum campaign when EU countries, including Germany and the Netherlands, barred Turkish ministers from holding rallies in support of the changes. Erdogan called the moves "Nazi acts" and said Turkey could reconsider ties with the European Union after many years of seeking EU membership.

FLAG-WAVING SUPPORTERS

On the eve of the vote, Erdogan held four separate rallies in Istanbul, urging supporters to turn out in large numbers.

Story continues

"April 16 will be a turning point for Turkey's political history... Every vote you cast tomorrow will be a cornerstone of our revival," he told a crowd of flag-waving supporters.

"There are only hours left now. Call all your friends, family members, acquaintances, and head to the polls," he said.

Erdogan and the ruling AK Party, led by Prime Minister Binali Yildirim, have enjoyed a disproportionate share of media coverage in the buildup to the vote, overshadowing the secular main opposition Republican People's Party (CHP) and pro-Kurdish People's Democratic Party (HDP).

Erdogan has sought to ridicule CHP leader Kemal Kilicdaroglu, playing videos of his gaffes during rallies, and has associated the "No" vote with support for terrorism.

Kilicdaroglu has accused Erdogan of seeking a "one-man regime", and said the proposed changes would put the country in danger. "This is not about right or left... this is a national issue... We will make our choices with our children and future in mind," he said during his final rally in the capital Ankara.

Proponents of the reform argue that it would end the current "two-headed system" in which both the president and parliament are directly elected, a situation they argue could lead to deadlock. Until 2014, presidents were chosen by parliament.

The government says Turkey, faced with conflict to the south in Syria and Iraq, and a security threat from Islamic State and Kurdish PKK militants, needs strong and clear leadership to combat terrorism.

The package of 18 amendments would abolish the office of prime minister and give the president the authority to draft the budget, declare a state of emergency and issue decrees overseeing ministries without parliamentary approval.

(Editing by Dominic Evans and Andrew Bolton)