After weeks of uncertainty the Turkish public opinion polls predicting a small margin of victory for the ruling Justice and Development Party (AKP) in Turkey's constitutional referendum earlier this month turned out to be correct. Just under 48 million voters took part in the referendum, in which there were about 1.3 million more voting for than voting against, giving President Recep Tayyip Erdogan a 51 per cent majority. This was a couple of percentage points above the AKP's showing in the November 2015 general elections, but the result produced little exultation. The AKP was allied in the referendum with the rightwing Nationalist Action Party (MHP), and it ought to have picked up a substantially higher percentage of the vote. Its narrow victory came after a campaign that had been fiercely criticised in some quarters outside Turkey as “the end of democracy” largely because of restrictions on the access by those against to the airwaves, media, and advertising and widespread complaints of an atmosphere of pressure surrounding the referendum, including the country's nine-month state of emergency. In the hours after the campaign ended and during the astonishingly rapid count of the ballot papers (typical of Turkish elections), there was a bitter and angry mood among the losers, together with some protests against the result. A spate of alleged irregularities at polling booths and allegations of up to 1.5 million “unregistered unstamped ballot papers” allowed by the election authorities even though they are not usually regarded as legal sparked fierce criticisms. The opposition wants a recount of up to 40 per cent of the 48 million votes cast, and following the announcement of the results there were angry protests in some Turkish cities. However, Erdogan has got his mandate to redesign Turkey's governing system, assuming powers over legislation and the budget not enjoyed by the leaders of Western democracies. Culturally conservative elements in Turkey like the daily newspaper Yeni Akit hailed the referendum result as the death of the old secularist Turkey and published a mock funeral announcement of it. But Erdogan looked a little sombre on Turkish television as he made his victory speech, indicating that the new constitution would not be introduced until 2019 when his present term of office ends. He said he would view the early reintroduction of the death penalty favourably, a pledge he repeatedly made during the campaign but one which would trigger a breach with the European Union and end Turkey's EU candidacy. Though the implementation of the new constitution may have to wait for two years (it is not altogether certain that it will as many aspects of it already exist in practice), Erdogan will now definitely move closer to the AKP and perhaps even resume the Party leadership that he gave up when he was elected president in 2014. In the meantime, the AKP must reflect on how to respond to two pieces of bad news in the referendum results. The first is that the “no” campaign won in 10 key provinces in southeastern Turkey, demonstrating that many ethnic Kurdish voters there reject the new constitution. The second is that Turkey's five largest cities all voted “no”, including Istanbul and Ankara, albeit narrowly. The AKP has put a determined face on this bad news, pointing out that there was a strong swing to it in several of the Anatolian provinces. However, it should be remembered that the poll was not only held under state of emergency conditions, but also that in most if not all of these provinces elected officials have been replaced by Ministry of Interior appointees. The glaring political problem in Turkey's southeast has been exposed once again to public view, even though the region has been largely pacified in military terms. The second big upset means that the sea of flag-waving, cheering crowds who listened to Erdogan as he campaigned for a “yes” vote in the referendum did not translate into an easy victory. Istanbul and Ankara have been under the control of the AKP or its predecessor the Welfare Party since 1994. Without them, the party risks shrinking to its strongholds in the conservative provinces of Turkey's interior, with only a few cities, notably the large cities of central Anatolia, remaining loyal. Nevertheless, the AKP does not currently face any serious challengers from Turkey's weak and poorly led opposition parties. The right wing is divided, and the leaders of the pro-Kurdish Peoples' Democratic Party are in prison on terrorism charges. The AKP's main opponent, the centre-left Republican People's Party (CHP), has lost election after election without ever changing its leader. Unlike Western political parties, it also lives off generous budget subsidies rather than an active grassroots organisation. Its chronic unreality was demonstrated by celebrations at the CHP's Ankara headquarters following the referendum at the narrowness of the margin by which it had been defeated. In the closing days of the campaign, Erdogan warned that the CHP could be relegated to a “museum of extinct political species” after the referendum had taken place. He even hinted ominously that CHP leader Kemal Kilicdaroglu could have held discussions with the leaders of the attempted coup in Turkey last summer. However, the most important item on the government's agenda over the next few weeks will probably be the EU, especially if legislation on the reintroduction of the death penalty to Turkey goes ahead. The challenge has already been taken up by Brussels, and within a few hours of the announcement of the result of the referendum president of the EU Commission Jean-Claude Juncker, External Affairs Representative Federica Mogherini and Enlargement Commissioner Johannes Hahn issued a terse joint statement. Instead of the congratulations which Ankara might have regarded as its due, Juncker promised an Organisation for Security and Cooperation in Europe investigation of alleged irregularities in the holding of the referendum and called on Turkey to respond to concerns expressed by the Council of Europe over its continuing state of emergency. This is the first time that the EU has flung down the gauntlet to Turkey in this way, rather than avoiding a confrontation by staying silent. The sharp change in tone is linked to the accusations of Nazism made against the Netherlands and Germany by Erdogan last month. The latter will almost certainly respond angrily to these criticisms, using the confrontation to fire up his support inside Turkey. A further battle of words with the EU is probable, and despite its heavy economic and political cost an outright rift may follow. The writer writes regularly on Turkish history and politics and is finishing a book on the Ottoman Empire in the 19th century.