The head of the top court in Turkey has asked prosecutors to consider whether PM Recep Tayyip Erdogan should be charged over critical comments.
The PM said a key ruling was "a disgrace to the justice system"
Tulay Tugcu, head of the Constitutional Court, condemned Mr Erdogan for "threats, insults and hostility" towards it.
The prime minister this week again criticised a ruling that cancelled parliament's election of the president.
Mr Erdogan said the ruling was "a disgrace to the justice system".
Ms Tugcu said she planned to file a complaint against Mr Erdogan following his remarks, which she said exceeded "boundaries of respect".
"No-one can act outside the constitutional framework," she said.
A prosecutor will investigate whether there is a need for a full judicial investigation.
However, Mr Erdogan has political immunity and the prosecutor would have to get parliamentary permission for the judicial review. If permission is given, it could lead to charges.
In April the main secular opposition boycotted two attempts by parliament to elect as president the candidate of the governing AK Party, which has its roots in political Islam.
The parties accused Abdullah Gul of a hidden Islamist agenda, a charge he denies.
The Constitutional Court declared the presidential vote invalid, because the boycott meant there was no quorum.
Prosecutors have already investigated earlier comments by Mr Erdogan about the court's decision, including saying it had fired a "bullet at democracy".
The court ruling prompted the AK Party to push for the president to be directly elected by the people, rather than parliament.
Mr Erdogan's government also called an early general election for 22 July to try to resolve the crisis.