ISTANBUL — President Recep Tayyip Erdogan of Turkey on Wednesday called elections for June 24, almost a year and a half earlier than scheduled, saying the situation in Syria and Iraq, as well as economic stability, demanded it.

Mr. Erdogan has long made it clear that he intended to run for re-election — he has led the country for 15 years, first as prime minister, then as president — and speculation had been rife for months that he would call elections early.

He nonetheless surprised many observers by calling the elections so soon, as well as while Turkey remains under a state of emergency. The state of emergency, in place since a failed coup in July 2016, gives the police added powers, restricts the right of assembly and is likely to constrain campaigning.

But Mr. Erdogan’s abrupt move seemed intended to seize a ripe moment — he remains the country’s most popular politician, with some 40 percent support — to consolidate his powers at a time when domestic politics in Turkey and international trends seem to favor leaders in his autocratic style.