Opposition parties are likely to demand limits on President Recep Tayyip Erdogan's role in Turkey's next government, complicating coalition talks as the ruling party sought ways Tuesday to remain in power.

Erdogan meanwhile, accepted the resignation of Prime Minister Ahmet Davutoglu's government to allow the formation of a new government after his ruling party lost its parliamentary majority in a national vote, forcing it to seek a coalition deal with smaller parties.

Tuesday's resignation is a political formality and the government will stay in office until a new one is set up. Davutoglu's status remains uncertain after the humiliating setback for the party.

The ruling Justice and Development Party, or AKP, won less than 41 percent of the votes, getting 258 seats in the 550-seat parliament, 18 seats short of the minimum required to rule alone.

Erdogan has been a dominant and divisive figure as he fiercely campaigned in favor of the AKP, flouting a constitutional rule that required him to be neutral. He had hoped that the party, which he founded in 2001, would win a supermajority so it could reshape Turkey's democracy into a presidential system where he would wield control over government affairs.

The AKP now faces difficult negotiations to coax the right-wing Nationalists into the next government or, less likely, the main secularist Republican People's Party or the pro-Kurdish People's Democratic Party. If no deal is reached on a coalition, a fragile minority government and early elections loom.

Analysts say opposition parties are expected to demand that Erdogan stays within the constitutional boundaries of the largely ceremonial presidency and that the AKP abandon plans for a switch to a presidential system. It's not known if Erdogan, who needs to approve any new government, would sign off on such a deal.

On Tuesday, the pro-Kurdish party that upset Erdogan's ambitions by winning 80 seats in parliament again vowed not to enter in a coalition agreement with the AKP.

AKP deputy leader Yasin Aktay said, however, his party was not ruling out any coalition combinations.

"There is no need for gloom," Aktay said. "We will do all that is necessary to form a coalition and not leave the country without a government."

Erdogan, who dominated airwaves throughout the campaign, has hardly been seen in public since the election upset. A humorous clock on the Internet keeps tabs on the days, hours, minutes and seconds he has not appeared on airwaves.