Voting has closed in a referendum in Turkey on changing the constitution, which was drafted under military rule in the early 1980s.

The government says it wants to bring the constitution more in line with European Union standards.

Opponents argue that the governing party, which has its roots in political Islam, is seeking dangerous levels of control over the judiciary.

The result, due on Sunday evening, is expected to be close.

The 26 amendments, many of them backed by the EU, are being presented to voters as improvements to the 1982 constitution, says the BBC's Jonathan Head in Istanbul.

But two are seen by the opposition as granting the government excessive influence over the judiciary.

The governing Justice and Development Party (AKP), led by Recep Tayyip Erdogan, has repeatedly clashed with Turkey's highest courts, which see themselves as guardians of the country's secular values.

Analysis After a hard-fought and sometimes bad-tempered campaign, polls suggest Turkey is still more or less evenly divided between those who support Prime Minister Erdogan's reform package and those who oppose it. Most of the 26 constitutional amendments are uncontroversial and have been welcomed by the EU which Turkey is negotiating to join. But two, which would expand membership of two top judicial bodies, have been criticised by opposition parties for leaving the government with excessive influence over the judiciary. The higher courts have often been at odds with the government and are viewed by secular Turks as an essential check on Mr Erdogan's Islamically rooted Justice and Development Party. The prime minister accuses the court of making politicised judgements. His opponents accuse him of increasingly authoritarian leadership and say he cannot be trusted with such important amendments.

As he cast his ballot in Istanbul, Prime Minister Erdogan told reporters: "Turkish democracy is at a turning point today. This is an important test."

"Whatever the outcome, I wish the best for our public. I hope this referendum will bring goodness," said Turkish President Abdullah Gul as he cast his vote.

The referendum took place on the 30th anniversary of the military coup in 1980.

The secular opposition accuse the AKP of trying to seize control of the judiciary as part of a back-door Islamist coup.

Buke Acar, a voter in the capital Ankara, said she was voting "No" in order defend the rule of law.

"Not securing the independence of the judiciary is a big threat in democratic countries," she said.

The present constitution was introduced in 1982.

Proposed reforms The military would be more accountable to civilian courts

Parliament would have more power to appoint judges

Civil servants would be given the right to conclude collective agreements and go on strike

The immunity from prosecution for the leaders of the bloody 1980 military takeover would be lifted

"The constitution changed with the junta in the military coup days," voter Mehmet Yildirimlar told the Associated Press news agency in Diyarbakir.

"We stood against them in those days, because a military coup is no good.

"That's why we are here today. We voted 'Yes' for the sake of our children and youth. Because we have suffered a lot."

Security forces have clashed with Kurdish activists in south-eastern provinces where Kurdish militants have fought a long-running insurgency. One Kurdish party urged a boycott of the referendum.