It is not clear why police acted before the deadline as Anwar's lawyer had said his client would abide by the police order and was prepared to be arrested.
Later on Wednesday, Sankara NairAnwar's lawyers said that Anwar would remain in detention overnight and possibly longer.
"The excuse is that they need to take further statements" he said.
Sodomy is a non-bailable offence punishable by up to 20 years in jail in Malaysia.
Early this month, Anwar filed a defamation lawsuit against the 23-year-old man who claimed he was sodomised by the opposition leader.
A similar sodomy allegation 10 years ago led to his sacking as deputy prime minister and a prison sentence, but the country's highest court subsequently overturned the conviction.
He did, however, spend six years in prison on a related corruption charge.
"There's no basis for this whole fabrication and malicious attacks. It is just a repeat of the 1998 script. You can see the pattern," he said on Wednesday. "I will challenge them on every ground."
Earlier this month he filed a police complaint against the country's national police chief and the attorney-general over that incident, alleging the two had fabricated evidence against him.
Anwar, who on Tuesday debated with the information minister on the country's recent massive fuel price hike, has repeatedly said the current sodomy allegation was politically motivated to stop his campaign to topple the Barisan Nasional government.
The one-hour debate with Ahmad Shabery Cheek was Malaysia's first ever live television debate with a cabinet minister.