* Thousands protest to condemn sectarian violence
* New cabinet warns of a "counter-revolution"
* Egypt orders the detention of 4 senior police officers
By Dina Zayed
CAIRO, March 11 (Reuters) - Egypt's problems will melt under "the sunshine of freedom", the Grand Mufti said in a sermon attended by the ruling military council on Friday when thousands gathered across the country to condemn sectarian violence.
Sheikh Ali Gomaa prayed for God to bestow strength on the military which has been governing Egypt since Hosni Mubarak was forced from power on Feb. 11 by an uprising demanding political reform and an end to autocratic rule.
Addressing the sectarian violence that broke out in Cairo this week, killing 13 people, Gomaa said attacks on Christians were un-Islamic.
Thousands of Egyptians, both Muslim and Christian, gathered after Friday prayers to call for unity and to condemn the arson attack that ignited the sectarian tension.
Thirteen people were killed in clashes between Muslims in Christians in Cairo on Tuesday night after the arson attack on a church. Activists have described the violence as a threat to the revolution.
"Christians or Muslims, we are all Egyptians," protesters chanted. Several thousand gathered in Tahrir Square, the epicentre of the protest movement, to condemn the violence and a senior army officer held aloft a Koran and a cross while addressing demonstrators there.
"Hosni Mubarak is the strife," protesters in the square chanted. This reflects a view that remnants of Mubarak's administration had a hand in this week's tension.
Gomaa, appointed by Mubarak and Egypt's highest religious legal authority, said those killed in the uprising were martyrs.
"The martyr is he that orders the propagation of virtue and the elimination of vice. That is what happened on Jan. 25," Gomaa said, referring to the first day of the uprising that swept former president Mubarak from power.
"Let us not let their blood be lost in vain. Let us look to the future and end this fluid political and social period and bring back the economy, security and stability," he said.
Those attending the sermon included Field Marshal Mohamed Hussein Tantawi, head of the Supreme Council of the Armed Forces. He was surrounded by other senior military officers.
Some of these wept as an emotional Gomaa prayed for strength and vision in the weeks ahead in a sermon broadcast live on state television.
"Raise your head high, you are Egyptian," said Gomaa. "What will we do with the problems that have become like mountains? Those mountains will melt under the heat of the sunshine of freedom."
The violence between Muslims and Christians poses another challenge to the army as it manages a transition to democracy. It has pledged to hand over power in six months.
The new prime minister, in remarks published on Friday, warned of "counter-revolution" plots that he said were behind a state of lawlessness in the country.
"The internal situation has become very dangerous. We have reached some red lines due to the state of security breakdown," Essam Sharaf, who was appointed after a purge of officials linked to Mubarak, was quoted as saying in local newspapers.
"The government is convinced that what is happening is systematic and planned, and threatens the stability of the nation. That will make us decisive in confronting it."
In a move towards meeting demands for a clean-up of the police force, the public prosecutor ordered the arrest of four former senior Interior Ministry officials on suspicion of conspiracy to murder by ordering the killing of protesters.
On the orders of the new cabinet, the police force returned to the streets this week. It largely disintegrated at the start of the uprising. (Additional reporting by Abdel Rahman Youssef in Alexandria; Editing by Tom Perry and Robert Woodward)