Our car got stuck behind dozens of buses organised by Mr Erdogan's supporters.
They had been able to call in tens of thousands of demonstrators from across the country - and drive them to and from the rally.
At this point, it became clear that the prime minister would defeat protesters who had taken over Istanbul's Gezi Park.
The protesters were angry. But the prime minister was organised. In Turkey, organisation wins.
Recep Tayyip Erdogan now finds himself facing an opponent who is just as organised as he is: Fethullah Gulen.
The struggle between the two men poses a threat to Mr Erdogan's undeclared ambition to run for the presidency in 2014.
Fethullah Gulen is an Islamic scholar who founded an influential social and cultural network which now includes more than 900 schools in Turkey.
Profile: Fethullah Gulen's Hizmet movement
Mr Gulen himself has lived in self-imposed exile in the US since 1999. His followers hold senior positions in the Turkish police and judiciary.
For years, the Gulenist movement worked alongside Recep Tayyip Erdogan's alliance of the working class and religious and business communities.
This broad alliance won Mr Erdogan three general elections.
The Gulen movement's loyalists formed their own informal faction within the ruling AK Party.
In recent years, the Gulenists helped the prime minister to reduce the power of the armed forces.
But, during the Gezi Park protests in June, differences between Mr Erdogan and the Gulenist movement began to emerge.
Mr Gulen's supporters accused the prime minister of governing in an authoritarian manner - a charge Mr Erdogan dismissed.
Then, in November, the government announced plans to get rid of private schools which help students to prepare for university exams, including those run by Mr Gulen's movement.
This began the period of open conflict between allies of the prime minister and those loyal to Fethullah Gulen.
On 17 December, the police carried out dawn raids against leading businessmen and allies of the prime minister.
Many here believe that these raids were orchestrated by Gulenists in the police and the judiciary.
In June 2013, Recep Tayyip Erdogan survived the challenge posed by opposition demonstrators.
But this time the challenge comes from a much more organised opponent - whose ultimate goal remains unclear.
One Sunday in mid-June, my colleagues and I spent three hours trying to get out of a rally held in Istanbul by Turkish Prime Minister Recep Tayyip Erdogan.