ISPARTA, Turkey — President Recep Tayyip Erdogan’s abrupt decision to call elections more than a year ahead of schedule, hoping to catch the opposition off guard, may backfire.

Turkish opposition parties have come together in a rare alliance that could pose a serious challenge to Mr. Erdogan in his attempt to be re-elected in the June 24 vote to a presidency with vastly expanded powers.

Mr. Erdogan, 64, remains easily the most popular politician in Turkey. But the election, as with a referendum last year that created a more powerful presidential system, is turning into a vote for or against his continued rule.

The front-runner among the opposition candidates is Muharrem Ince, a physics teacher and five-time member of Parliament for the Republican People’s Party.