REUTERS - The United Nations Security Council failed on Saturday to condemn the violence and unrest in Turkey after Egypt objected to a statement that called on all parties to "respect the democratically elected government of Turkey," diplomats said.

The U.S.-drafted statement also expressed grave concern over the situation in Turkey, urged the parties to show restraint, avoid any violence or bloodshed, and called for an urgent end to the crisis and return to rule of law.

Statements by the 15-member Security council have to be agreed by consensus.

Diplomats, speaking on condition of anonymity, said Egypt argued that the UN Security Council was not in a position to determine whether a government had been democratically elected.

Egypt's mission to the United Nations did not immediately respond to a request for comment.

Turkish forces loyal to President Tayyip Erdogan largely crushed an attempted military coup on Saturday after crowds answered his call to take to the streets in support of the government and dozens of rebels abandoned their tanks.

Egyptian President Abdel Fattah al-Sisi is a former general who overthrew elected President Mohamed Morsi, of the Islamist Muslim Brotherhood, in 2013 after mass protests against Morsi. Turkey provided support for the Muslim Brotherhood in Egypt.

Some of Egypt's pro-army media jumped the gun in their reporting on the attempted coup in Turkey, declaring it a success and welcoming the overthrow of President Recep Tayyip Erdogan.

At least three newspapers ran headlines Saturday declaring that Turkey's army had overthrown Erdogan. But by the time their print editions came out, Turkey's government had largely succeeded in quashing the coup after a night of clashes that left dozens dead.