Mohammed el-Sharkawi, 24, and a member of Egypt's anti-government Kefaya movement, was dragged out of his vehicle as he tried to leave the demonstration on Thursday.
He was detained on charges which included insulting Hosni Mubarak, the Egyptian president,.
"I saw him before he was taken away, then in the evening. His appearance was completely different. His skin was covered in bruises and sores. Both his eyes were swollen red and blue," said his lawyer, Gamal Eid.
"His lips were bruised and split, and his chest was covered in bruises ... They had stripped his clothes off and sodomised him," Eid added, having spoken to Sharkawi on Thursday night.
He said his client was sodomised "using a rolled up piece of cardboard for nearly 15 minutes".
Eid said he saw his client while he and the other Kefaya detainee were being sentenced at the state security prosecution to 15 days' detention.
An interior ministry spokesman denied any beating had taken place.
"These torture claims are not true. It is not in anyone's interest to do this ... A lawyer will say anything to put pressure on because he's being paid to do so," the spokesman said.
Police beat, clubbed and detained hundreds of activists this month at peaceful protests in support of Egypt's judges, which drew criticism from Washington and the European Union.
Thursday's protest also marked the one-year anniversary of a protest against a referendum on a controversial constitutional amendment when police sexually harassed and brutalised female activists and journalists.
Three women were also roughed up on Thursday, including a six-month pregnant journalist.
Ahmed Nazif, Egypt's prime minister, has rejected the criticism and described the protesters as thugs.
Nazif said the police were keeping the peace while the interior ministry said the media were misrepresenting events.