His is one of dozens of cases opened by authorities in a crackdown on condoning or threatening terrorism.
Justice Minister Christiane Taubira said words of hatred and contempt had to be fought with the "utmost vigour".
Dieudonne already has convictions for inciting anti-Semitism and the courts banned several one-man shows last year.
A judicial source quoted by AFP news agency said he was due to be released on Wednesday evening but would face trial at a later date.
The justice ministry said earlier that 54 cases had been opened since the murders of 17 people in Paris last week. Of those, 37 cases involved condoning terrorism and 12 were for threatening to carry out terrorist acts.
Some fast-track custodial sentences have already been handed down under anti-terror legislation passed last November
The justice minister said prosecutors should act firmly and quickly against anyone found condoning terrorism or carrying out racist or anti-Semitic acts.
Dieudonne is already facing an inquiry into whether he condoned terrorism in a video in which he mocked the decapitation of US journalist James Foley by Islamic State militants.
If found guilty, he could face up to seven years in jail and a â‚¬5,000 (Â£3,800; $5,900) fine.
Hours after 3.7 million people took part in rallies across France on Sunday, with the biggest in the centre of Paris, Dieudonne said on his Facebook page that the "historic" march had been as magical as the Big Bang that had created the universe.
"I'm finally going home," he wrote. "Know that this evening, as far as I'm concerned, I'm feeling like Charlie Coulibaly [French:  je me sens Charlie Coulibaly]."
He combined the "Je suis Charlie" ("I am Charlie") slogan adopted across the world in support of the 17 victims of the Paris attacks with the name of one of the three Paris gunmen, before deleting the remark a short time later.
Coulibaly killed a policewoman near a Jewish school last Thursday before going on to hold up a kosher supermarket the following day when he murdered four Jewish hostages.
Dieudonne's comment drew an angry response on Monday, with Prime Minister Manuel Valls saying that freedom of speech should not be confused with anti-Semitism, racism and Holocaust denial.
After Interior Minister Bernard Cazeneuve said he had asked the authorities to investigate Dieudonne's remarks, the comedian posted a response on his Facebook page, arguing that he was being treated as public enemy number one when all he wanted to do was make people laugh.
"I'm being seen as an Amedy Coulibaly when I'm no different from Charlie," he said.
The murders at Charlie Hebdo by the Kouachi brothers were widely seen as an assault on freedom of speech, on a magazine that has frequently launched withering attacks on religion, with depictions of the Prophet Muhammad.
The publication of a new issue of Charlie Hebdo on Wednesday was so sought-after that the publishers increased the print run to 5m copies.
Dieudonne's detention immediately drew claims of double standards from some quarters in France.
But French daily Le Monde pointed out (in French) that French law limited freedom of speech and it did not extend to incitement to hatred or racism, anti-Semitism and homophobia.
In 2007, the then editor of Charlie Hebdo, Philippe Val, was cleared of inciting hatred against Muslims for reprinting cartoons of the Prophet Muhammad.
Dieudonne was himself acquitted last year over comments made in a video in which he called for the release of a man who tortured and murdered Ilan Halimi, a Jewish man, in Paris in 2006.
His trademark "quenelle" gesture has been criticised as an inverted Nazi salute although he argues it was intended to be anti-establishment.
Controversial French comedian Dieudonne M'bala M'bala has been detained by police for a Facebook comment appearing to back Paris gunman Amedy Coulibaly.