If there’s a lesson to be drawn from the November 1 Turkish elections, it’s that fear works, and there are few people better at engendering it than Turkish President Recep Tayyip Erdogan. Only five months after his Justice and Development Party (AKP) lost its majority in the Turkish parliament, a snap election put it back in the driver’s seat.

The cost of the victory, however, may be dear.

To achieve it, Erdogan reignited Turkey’s long and bloody war with the Kurds, stood silent while nationalist mobs attacked his opponents, and unilaterally altered the constitutional role of his office.

Observers from the Council of Europe and the Organization for Security and Cooperation in Europe said that violence and attacks on the media had a significant impact on the election. “Unfortunately we come to the conclusion that this campaign was unfair, and was characterized by too much violence and fear,” said Andreas Gross, a Swiss parliamentarian and head of the Parliamentary Assembly of the Council of Europe delegation.

At the same time the European Union itself seemed to favor an AKP victory. The EU Commission held off a report critical of Turkish democracy until after the vote. And two weeks before the election, German Chancellor Angela Merkel visited Turkey bearing $3.3 billion in aid for Syrian refugees and an offer for Turkey to revive its efforts to get into the EU. Previously, Merkel had been opposed to Turkish membership in the EU.

The finally tally is almost everything Erdogan wanted, although he fell short of his dream of a supermajority that would let him change the nature of the Turkish political system from a parliamentary government to one ruled by a powerful and centralized executive — himself.

The Formidable Erdogan

There are 550 seats in the Turkish parliament. The AKP took 49.5 percent of the vote and won 317 seats, an increase of 59 over the June election. While 276 seats is a majority, what Erdogan wanted was a supermajority of 367 seats, which would allow him to change the constitution without involving the electorate. He did not achieve this.

The secular Republican People’s Party (CHP) picked up two seats over the June election for a total of 134 seats. The left-wing and Kurdish-dominated People’s Democratic Party (HDP), which scored an historic 13.1 percent of the vote and 80 seats in the June election, managed to squeak by with 10.8 percent of the vote and 59 seats. If it had failed to pass the 10 percent barrier for parliamentary representation, most of its seats would have gone to the AKP, possibly giving Erdogan’s party the supermajority it craved.

Indeed, it was a statement of the HDP’s resilience that despite the violence directed at the party and the arrest of many HDP activists, the organization still managed to clear the threshold for representation in the parliament. The HDP announced that it planned to challenge several seats that the party says involved fraud.

The right-wing Nationalist Action Party (MHP), meanwhile, dropped dozens of seats, falling to fourth place with only 40. It would appear that most of its voters jumped to the AKP.

Erdogan set out to change the Turkish constitution back in 2007 and has pushed to reconstruct the country’s politics ever since. However, the AKP has never had 330 votes in the parliament, the number needed to place a constitutional referendum before the voters. Erdogan did not get that magic number this time either, but he may be able to pry a dozen or so votes from the ranks of the right-wing nationalists and get his referendum.

The AKP won almost 5 million more votes than it did last June. Voter turnout was over 86 percent.

A referendum is a disquieting thought. Erdogan is a relentless campaigner, and opponents are worried that, while most Turks do not show much enthusiasm for the changes he’s proposed, his scare tactics, repression, and money may be enough to push such a referendum through.

Pre-election polls predicted that the AKP would get about the same number of votes in November that it got in June. They were dead wrong. Erdogan’s formidable political skills and his willingness to polarize the country are not to be underestimated.

Cracking Down on Democracy

While the AKP now has a majority, it’s come at the expense of re-igniting the war with the Kurds, a conflict that’s cost Turkey $1.2 trillion and some 40,000 lives over the last few decades. Lately it’s also seen an almost unprecedented wave of attacks on the Kurdish party, its supporters, and the press.

Four days before the election, police raided the offices of Koza Ipek Media, closing down two newspapers and two TV stations. The news outlets have been handed over to a government trustee who is investigating them for “supporting terrorism.” Koza Ipek is closely associated with Fethullah Gulen, an Islamic preacher currently living in exile in the U.S. Gulen and Erdogan were formerly allies, but had a falling out in 2012.

Erdogan has also gone after several other media outlets, including the Dogan Group, which owns Turkey’ popular daily, Hurriyet, and CNNTurk. Both outlets have interviewed politicians from the HDP, which the president charges is a front for the banned Kurdistan Workers Party (PKK). The PKK is designated a terrorist organization and the target of Turkey’s current war on the Kurds.

While there is a relationship between the PKK and the HDP, the latter has sharply condemned the violence of the former and has a far broader base among Kurds and non-Kurds alike. Apparently some conservative religious Kurds who voted for the HDP in June were spooked by the violence and returned to the AKP.

Mobs led by the Ottoman Hearths — the youth arm of the AKP — and the Idealist Hearth — youth arm of the right-wing MHP— have burned HDP offices, attacked Kurdish businesses and homes, and attacked left-wing book stores. In early September, a nationalist mob rioted for seven hours, burning offices and stores in the city of Kirsehir, while police stood by and watched.

The chair of a local branch of the HDP, Demet Resuloglu, said she warned police about the mob, but they did nothing. She and several others were temporarily trapped in a bookstore by a mob that set the establishment on fire. “We escaped with our lives after jumping from the second floor. It was an organized affair. Everything happened with the knowledge of the police, the governor and everybody,” she told the news outlet Al-Monitor.

Similar attacks took place in the resort towns of Alanya and Manavgat.

During the election campaign, Turkish Kurds and leftists were the targets of several bombings that took over 130 lives and were almost certainly the work of the Islamic State. But Erdogan blamed it on the PKK and tried to tar the HDP with the same brush.

Selahattin Demirtas, a leader of the HDP and a member of parliament, is currently being investigated for supporting “terrorism” and insulting the president. Since Erdogan became president in August of last year, more than 240 people have been charged with insulting him.

Running on Chaos

Erdogan is likely to treat the AKP’s victory as an endorsement of his campaign to overthrow Syrian President Bashar al-Assad, even though polls show that 63 percent of Turks disapprove of getting involved in Syria.

The war has turned into a disastrous quagmire, and the Europeans and the Russians are pushing for a political settlement. Erdogan — a man with a stubborn streak — will probably insist that Assad first must go, a formula that will endear him to the Gulf monarchies, but will almost certainly keep the war going. Turkey is already hosting 2 million Syrian refugees, and millions more may be headed toward Europe.

The Turkish president has unilaterally redefined the office of the president from one of neutrality to partisan activist. Rather than trying to form a coalition government after last June’s election — a major part of the president’s job — Erdogan sabotaged every effort to compromise, banking that he could stir up the furies of sectarianism and fear to create the climate for a comeback.

While the AKP is wealthy, parties like the HDP were tapped out by the June election and couldn’t marshal the resources for another national campaign. In the last weeks of the election the HDP canceled rallies, fearing they’d be attacked by right-wing mobs or create targets for Islamic State bombers.

Erdogan created chaos and then told voters the AKP was the only path to peace and stability. It was an argument a lot of voters bought.

But the costs are high.

The press has been muzzled, a war that was over has been re-started, and Turks and Kurds are once more at each other’s throats. The war in Syria is likely to drag on, and the polarization of Turkish society will deepen.

But the AKP has only a slim majority, and the peace and stability it promises is an illusion. As the British Guardian noted, “President Erdogan has got his majority back, but Turkey has been damaged in the process… Sadly, this election is unlikely to mark a passage into calm waters for Turkey.”