Police fired tear gas and arrested 25 people on Wednesday in central Cairo where hundreds had gathered to commemorate dozens of protesters killed by security forces in 2011, Egypt's interior ministry told state news agency MENA.
The rally was a rare sign of defiance against strict protest laws imposed by the government of President Abdel Fattah el-Sissi, the former army chief who has also allowed military courts to try civilians in a crackdown that began with Islamist supporters of ousted President Mohamed Morsi.
Activists had planned a march in streets near Tahrir Square on the anniversary of the deaths of 42 people three years ago when Egyptians demonstrated against the government that took power following an uprising that toppled autocrat Hosni Mubarak.
A security source said the detainees would be released "soon," but a decree passed last month means they could be tried in military courts for blocking the road.
In Alexandria, four people were arrested, including leading activist Mahienour el-Massry, according to the "Free Mahienour" Facebook page. The page said those detained were not protesting.
It gave no more details on the arrests.
Authorities in Egypt's second biggest city were not available to comment.
Massry was sentenced to two years in prison last year for protesting outside a court trying two policemen accused of killing a man whose death in 2010 helped to ignite the uprising against Mubarak.
She was released in September following an international outcry against her sentence.