Anti-government protesters clashed with police in Istanbul on Friday amid public anger at the corruption scandal gripping the country.

Rocks and firecrackers were hurled at police who unleashed water cannon, tear gas and plastic bullets as they attempted to quell the demonstrations. At least 31 people, including three lawyers, were arrested, according to the Istanbul Bar Association.

The demonstrations and political turmoil surrounding allegations of corruption helped push the Turkish lira to new lows against the euro and the dollar.

Download the new Independent Premium app Sharing the full story, not just the headlines

The street clashes were the latest challenge to the government which earlier in the day had suffered another setback when a high court ruling thwarted its attempt to change the rules on how corruption investigations are instigated.

Public anger about corruption has been running high and was intensified by the recent arrest of 24 people which forced three ministers to resign from the government when it was revealed their sons were among those detained.

The Prime Minister, Recep Tayyip Erdogan, has said the arrests were part of a conspiracy to topple his administration. His critics have in turn accused him of trying to stifle the investigation. Media reports have said the investigation is looking at alleged illicit money transfers to Iran and bribery for construction projects.

Fears that the scandal could lead to a military coup were raised when a close ally of Mr Erdogan suggested in a newspaper that it was a possibility, and perhaps even the intention of those behind the investigation, that the armed forces could seize control.

Three military coups have taken place in Turkey the last 50 years and Mr Erdogan has taken measures to reduce the power of the armed forces.

A statement issued by the military on Friday denied that there was any intention to become involved in “political debates” but warned that it “will keep on closely following the developments regarding its corporate identity and the legal positions of its members”.

The court ruling on Friday was a blow to Mr Erdogan because it blocked his attempt to prevent prosecutors from launching corruption probes without the approval of their superiors, many of whom, say critics, are allied to the government.

Before the ruling was made he accused Muammer Akkas, a prosecutor involved in the investigation that led to the recent wave of arrests and who reportedly wanted to summon Mr Erdogan’s son Bilal for questioning, of smearing innocent people and of being “a disgrace”.

On Thursday Mr Akkas had issued a written statement accusing the chief prosecutor and police of hampering the investigation. Turan Colakkadi, Istanbul’s chief prosecutor, responded by removing Mr Akkas from the case.

Kemal Kilicdaroglu, the leader of Turkey’s main opposition Republican People’s Party, condemned the government’s handling of the investigation. He said: “We have entered an era where the thieves are being protected and prosecutors who are going after the thieves are rendered ineffective.”