Turkish Prime Minister Ahmet Davutoglu has handed his formal resignation to the president after Turkey's ruling party lost its parliamentary majority for the first time in 13 years. The Justice and Development Party, or AKP, suffered a blow in Sunday's general election and will have to seek a coalition partner among smaller parties.

The prime minister met with President Recep Tayyip Erdogan Tuesday in Ankara to hand in his resignation. An official statement said the president accepted Davutoglu's resignation, and that the prime minister will stay in the post until a new government is formed. The Turkish president did not speak publicly.

"It has been two days. I believe the ticking clock has passed two days as we speak. This is an important evaluation. We are not used to this. Turks are not used to this. Our president speaks frequently and his speeches are always broadcast on live TV. We have fallen into an abyss," said Deniz Zeyrek, editor of Hurriyet newspaper.

Prime Minister Davutoglu will try to form a coalition government; the right-wing Nationalist Movement Party (MHP) is seen as a possible partner. The negotiations may not be easy. The party's leadership already has criticized Erdogan's ambitions for an executive presidency, contrary to Turkey's constitution. Some of the president's former allies have criticized his pre-election statements promoting the party he helped found in 2001.

"The constitution stresses impartiality. The oath that the president takes also stresses impartiality. Therefore, some of the voters reacted against the president's brazen support for one party and rhetoric against other parties," said Abdullatif Sener, a founding member of the AKP and a former friend of Erdogan.

Opposition leaders who now could enter the government in a coalition have made clear they will not tolerate Erdogan's interference.

The United States said Tuesday it is looking forward to working with Turkey's next government.

"Turkey is a NATO ally of the United States, and we're committed to continuing our close political, economic and security cooperation," said White House spokesman Josh Earnest.

The United States has praised Turkey's efforts to block the flow of foreign fighters crossing its borders to join Islamic State in Iraq and Syria, but is urging Ankara to do more.