Now, we are hours into a standoff between protesters and police in Taksim Square in Istanbul. This started almost two weeks ago with peaceful environmental protests by people who said they were opposing a government plan to turn a park into a mall development.
Since then we have seen the protests spread across the country and to the capital, Ankara, with police using water cannon and tear gas and protesters throwing Molotov cocktails and fireworks.
Erdogan left the country on a North African trip shortly after the protests began and by all accounts was taken by surprise, this being the first major challenge to his rule. He is now in his third term and has been in power for more than a decade.
Turkey is one of the main regional players, a strong NATO partner and for decades a key ally to the West, vital in crises such as Iran, Syria and Iraq.
Prime Minister Recep Tayyip Erdogan has a deep personal and political bond with President Barack Obama and many Western leaders in Europe. He was one of the first leaders Obama visited after his inauguration and Erdogan was at the White House in May, just before the protests started, when Syria was the focus of their attention.
After all the progress he has brought to Turkey -- sidelining the very intrusive military from politics, instituting democratic reform and reforming the police and judiciary -- there are many Turks who believe he has grown too authoritarian and arrogant.
There is a sense among Turkey's young business and secular elite that he is not listening anymore.
At first Erdogan dismissed the protesters as louts and riff raff. He then said he would talk to some of them -- those who he said were the "legitimate protesters."
He has condemned the people he says have joined this movement and hijacked it. He says they are trying to undermine Turkey, trying to damage its booming economy and trying to give the country a bad name.
Erdogan's chief adviser Ibrahim Kalin said protesters will be allowed to stay in Gezi Park adjacent to Taksim Square, but not in the square itself which is a major commercial thoroughfare integral to the workings of Istanbul.
He said Erdogan is willing to talk to the protesters on Wednesday but the question remains; Will they be able to separate out what they see as the legitimate and the illegitimate protesters?