ISTANBUL — Turkish voters delivered a rebuke on Sunday to President Recep Tayyip Erdogan as his party lost its majority in Parliament in a historic election that thwarted his ambition to rewrite Turkey’s Constitution and further bolster his clout.

The results represented a significant setback for Mr. Erdogan, an Islamist who has steadily increased his power since being elected last year as president, a partly but not solely ceremonial post. The prime minister for more than a decade before that, Mr. Erdogan has pushed for more control of the judiciary and cracked down on any form of criticism, including prosecuting those who insult him on social media, but his efforts appeared to have run aground on Sunday.

The vote was also a significant victory to the cadre of Kurds, liberals and secular Turks who found their voice of opposition to Mr. Erdogan during sweeping antigovernment protests two years ago. For the first time, the Kurdish slate crossed a 10 percent threshold required to enter Parliament.

Mr. Erdogan’s Justice and Development Party, or A.K.P., still won the most seats by far, but not a majority, according to preliminary results released Sunday night. The outcome suggests contentious days of jockeying ahead as the party moves to form a coalition government. Already, analysts were raising the possibility Sunday of new elections if a government cannot be formed swiftly. Many Turks were happy to see Mr. Erdogan’s powers curtailed, even though the prospect of a coalition government evokes dark memories of political instability and economic malaise during the 1990s.