In his first televised speech since the parliamentary elections on Sunday, the Turkish president, Recep Tayyip Erdoğan, has urged all four parties represented in parliament not to leave the country hanging in limbo and to quickly work on forming a new government.

Speaking at a graduation ceremony for international students, Erdoğan finally broke his silence after voters snubbed his plans to change the constitution in order to extend his grip on power.

For the first time since his Justice and Development party (AKP) swept to power in 2002 it failed to garner a parliamentary majority, leaving it to either form a coalition or try to go it alone in a minority government. If either option should fail, Turkey might face snap elections.

Erdoğan promised to do everything in his duty to find a solution to the current stalemate, adding that he would remain within the powers given to him by the constitution.

“Egos should be set aside and a [coalition] government should be formed as soon as possible,” Erdoğan said. “Nobody will be able to shoulder the responsibility of leaving Turkey without a government.”

He also again lashed out at the western press for its “aggressive stance” and criticised western countries for ignoring the plight of Syrian refugees at Turkey’s borders.

The president had stayed off air for an uncharacteristically long stretch of almost four days after clocking a record amount of hours on live TV in the runup to last Sunday’s elections.

In the meantime, the prime minister, Ahmet Davutoğlu, said his party did not exclude any of the opposition parties from becoming a possible coalition partner.

“I will hold sincere talks with all opposition parties. Nobody has the right to set any red lines for the AKP,” he said in a live interview on state television on Wednesday.

He added that Erdoğan would not be meddling in negotiations. “President Erdoğan is not part of coalition negotiations but will step in to help overcome deadlocks,” Davutoğlu said.

Earlier this week Erdoğan held a surprise meeting with Deniz Baykal, a senior politician and former leader of the main opposition Republican People’s party (CHP). Baykal told the press the president was not opposed to a coalition government. The talks triggered speculation the CHP was to team up with the AKP in a grand coalition.

But so far none of the three opposition parties have expressed great enthusiasm about forming a coalition government with the AKP.

On Thursday, Selahattin Demirtaş, co-chair of the leftist Peoples’ Democratic party (HDP), signalled that his party was open to team up with any or all opposition parties, but reiterated his stance that a coalition with the AKP was out of the question. He added that it was important to keep working on a compromise instead of immediately considering snap elections.