Egypt's prosecutor general has ordered the detention of former President Hosni Mubarak, ahead of an investigation into corruption and abuse allegations.
He is said to be in an "unstable condition" in hospital with heart problems. He has been ordered to be detained for 15 days.
His sons Alaa and Gamal have also been detained amid allegations of corruption and violence, police say.
Mr Mubarak stood down in February after a popular uprising against his rule.
Since then, tens of thousands of protesters have staged weekly Friday protests in Cairo's Tahrir Square.
They want the ousted president to be put on trial for the deaths of protesters and alleged abuse of power during his 30-year rule.
Official records show that 360 people were killed during the protests, but rights groups put the figure at about 800 dead and hundreds more wounded.
The Revolution Youth Coalition, an umbrella group of organisations involved in the protests that led to Mr Mubarak's downfall, said it welcomed the steps to bring Mr Mubarak and his family to justice.
The coalition called off mass protest planned for Friday in Cairo, saying one of its long-standing demands had been met.
The detention of Mr Mubarak is an exceptional turn of events for a leader in the Arab world, says the BBC's Yolande Knell in the Egyptian capital.
But the general public is suspicious at the timing of Mr Mubarak's heart problems and worried that ill-health, combined with old age, could prevent him from being tried, our correspondent says.
A post on the prosecutor general's Facebook page on Wednesday said: "The prosecutor general orders the detention of former President Hosni Mubarak and his sons Gamal and Alaa for 15 days pending investigation after the prosecutor general presented them with the current state of its ongoing investigations."
Reports at first indicated he was well enough to undergo questioning, but later his health was said to be "unstable", according to medical sources in the Sharm el-Sheikh hospital where he was admitted on Tuesday.
Later on Wednesday, state TV announced Mr Mubarak and his sons were to be questioned in a Cairo court on 19 April, Reuters news agency said.
The former Egyptian leader had been keeping a low profile in Sharm el-Sheikh, a Red Sea resort, after fleeing to his holiday villa there when he was overthrown.
Late on Tuesday, a crowd of about 2,000 people had gathered outside the hospital, demanding that the sons be arrested.
As a police van with drawn curtains took away the two brothers for questioning, the crowd pelted it with water bottles, stones and their flip-flops, the AP news agency reported.
On Wednesday morning the pair were transferred to Tora prison complex in Cairo, home to other fallen officials and some of the country's most notorious political prisoners.
Speculation that the younger son, Gamal, was being groomed to take over from his father helped to galvanise Egypt's protest movement.
Gamal, an investment banker, was a high-ranking member of President Mubarak's ruling party. His close associates were billionaires and held top positions in the ruling party and the government.
Mr Mubarak, along with his sons and their wives, have been banned from leaving the country. The family's assets have been frozen.
In a pre-recorded audio message on Sunday, he broke his silence of the last two months to say his reputation and that of his sons had been damaged and he would work to clear their names.