(Bloomberg) -- Turkey’s election this month could go down to the wire, with President Recep Tayyip Erdogan facing a tougher battle to cement power or even an upset, according to a poll commissioned by Bloomberg.

Erdogan can win the presidential vote in the first round on June 24 with 50.8 percent support and get the backing of a majority in parliament, the survey by Foresight Danismanlik of 500 people on June 7-11 found. But a surprise victory for the opposition is also within the margin of error.

The key takeaway is that any array of options is possible and the only certainty is that it will be very close. Erdogan and his AK party can’t win alone, and in previous elections they got the support of religious conservatives, free-market liberals or Kurds to govern. Now success hinges on how voters identifying as nationalist cast their ballot, the poll found.

The most powerful factor tilting the result in Erdogan’s favor is the unwavering devotion to him and his AK party. Very few core supporters can imagine themselves voting for anyone else even as the deterioration of the economy looms large. But nationalists have been deserting their traditional party.

“Erdogan always needed and will need coalitions," said Mert Yildiz, a former senior emerging-markets economist for Roubini Global Economics in London who co-founded Foresight in March 2017. “Even if Erdogan wins both the parliament and the presidency, political uncertainty is unlikely to end."

Margin of Error

The survey is Foresight’s first for Bloomberg, and the first of its kind in Turkey. The pollster selected a district based on various demographic and socio-economic characteristics and one that voted in line with the past three election results. The margin of error is 3.5 percentage points, wider than that of a typical poll because of the smaller sample size.

Erdogan’s closest opponent for the presidency is Muharrem Ince of the CHP. He polled at 30.1 percent. Ince was followed by pro-Kurdish HDP candidate Selahattin Demirtas, who despite running his campaign from prison, polled at 10.5 percent. Former Interior Minister Meral Aksener of the new Iyi Party polled 8 percent, trailing most expectations.

Should the presidential race go to a second round run-off, Erdogan’s lead would be more substantial, the polling showed. The parliamentary vote, though, is more complicated.

Crucially, Demirtas’s party also polled above the 10 percent threshold that will allow its deputies to enter parliament and possibly deprive Erdogan of a supportive legislature.

HDP was on course to take 11.7 percent of the vote, compared with just 4.5 percent for the nationalist MHP. Deputies from MHP will enter parliament regardless because of their alliance with Erdogan’s AKP, which polled 46 percent. Ince’s CHP was on 27.5 percent for the parliamentary vote and Iyi at 9 percent. Both Erdogan and Ince are significantly more popular than their respective political parties.

“Even though Erdogan is likely to win power, the true winner of these elections will be Muharrem Ince," said Foresight, which advises Turkish municipalities and conducts polls on their behalf.

Deteriorating Economy

The economy is the most pressing concern for voters, with 34.2 percent of respondents saying it’s the nation’s most important problem. That was followed by 17.7 percent who said terrorism and 13.5 percent who named unemployment.

The vote comes after the lira plunged in value and soaring inflation, making economic performance a liability for Erdogan for the first time in his 15 years leading the country.

The president has unnerved investors with unconventional theories on economic fundamentals and attacks against the central bank. That was exacerbated when, in an interview with Bloomberg Television in London on May 14, Erdogan said he’d look to take greater control of monetary policy after the vote.

But while a plurality of respondents -- 35.9 percent -- said their living standards had gotten worse in the past year, very few of his supporters are likely to turn on him. Only 4.6 percent of AKP voters said they’d vote for Ince.

“Despite the excitement around the opposition parties and candidates’ campaigns, none of the candidates can truly steal votes from Erdogan loyalist AKP voters," Foresight said.

To contact the reporter on this story: Benjamin Harvey in Istanbul at bharvey11@bloomberg.net

To contact the editor responsible for this story: Rodney Jefferson at r.jefferson@bloomberg.net

©2018 Bloomberg L.P.