* Top judge says allegations against judiciary caused "trauma"
* Justice minister retaliates with sharp criticism
* Judiciary caught up in PM's power struggle with cleric
* President approves law widening spy powers (Adds approval of spy agency law)
By Gulsen Solaker
ANKARA, April 25 (Reuters) - In a defiant challenge to Turkey's prime minister, the head of the Constitutional Court complained on Friday of political criticism which he said had traumatised and divided the judiciary.
Hasim Kilic's uncompromising speech, made in the presence of a grim-looking Prime Minister Tayyip Erdogan, will exacerbate the tense relationship between the government and judiciary, creating a further headache for Erdogan as he weighs a run for the presidency.
Erdogan has said swathes of Turkey's lawyers and police are under the sway of his arch-foe, U.S.-based Muslim cleric Fethullah Gulen. He has clashed with judges over a series of rulings.
"To say that the Constitutional Court acts with a political agenda or to blame it for not being patriotic is shallow criticism," chief judge Kilic told a ceremony broadcast live on local TV channels.
"It is striking that a constitutional ruling has been criticised excessively with political worries," he said, in a reference to Erdogan's comment this month that he did not respect the court's lifting of a government-imposed ban on Twitter.
That ban was seen by Erdogan's critics as an attempt to halt a string of audio leaks purportedly revealing corruption in the government. Erdogan has branded the audio clips, which he says are "fabricated", as part of a campaign waged by Gulen and his followers in the judiciary to wreck the government.
Gulen, a former ally of Erdogan's ruling Islamist-rooted AK Party, denies these claims. Critics say the prime minister is destroying judicial independence and media freedoms in Turkey in a bid to cover up corruption in his inner circle. He rejects that accusation.
In a separate development on Friday, Turkey's president approved a law boosting the powers of the secret service, in a move Erdogan's critics see as a bid to tighten his control.
The law gives the secret service more scope for foreign operations and eavesdropping, while offering top agents greater immunity from prosecution.
In his speech, judge Kilic said Erdogan's allegations that parts of the judiciary formed an effective "parallel state" in Turkey were "very dire and serious".
"It is impossible for the judiciary to remain on its feet while it remains tarnished with this allegation," Kilic said, urging those behind the claims to provide evidence.
"The allegations caused a psychological trauma within judicial institutions," he said.
Erdogan, famed for his intolerance of criticism, abruptly left the ceremony after Kilic's speech, skipping a reception.
His justice minister, Bekir Bozdag, accused the judge of behaving like the political opposition.
"Apparently the main opposition party and other opposition parties have failed...and our constitutional court head seems to be intent on filling this gap," he added.
The corruption scandal erupted when police detained sons of ministers and businessmen close to Erdogan on Dec. 17.
Thousands of police and judiciary members have been removed from their posts and access to social media sites blocked, in what is widely regarded as a backlash against the probe.
Erdogan remains Turkey's most popular politician after presiding over a decade of strong economic growth. His party trounced its rivals in March local elections, a result which has restored some calm to Turkish politics and financial markets.
Erdogan is keen to avoid renewed tensions ahead of his expected bid for Turkey's presidency in an August election, a move opponents fear could feed what they see as his authoritarian instincts. (Additional reporting by Ozge Ozbilgin, Humeyra Pamuk and Ece Toksabay; Writing by Daren Butler; Editing by Mark Trevelyan)