Fakhruddin Ahmed, the country's interim head of government, in a brief televised speech late on Wednesday, said: "This is a temporary measure. The curfew will be lifted as soon as the situation improves."
The curfew cleared cities of protesters, forced residents to stay home and temporarily shut down mobile phones.
Mobile phone service was restored early on Thursday, but stores and offices remained closed, streets were empty of cars and security forces were stopping anyone out walking or taking tricycle rickshaws.
Seven journalists were arrested during the curfew, the private CSB news channel reported. United News of Bangladesh (UNB) said at least two journalists were beaten up despite showing press cards.
Violent protests began on Monday night.
Clashes had followed a troop assault on students after they protested the presence of soldiers at a football match at Dhaka University's gymnasium compound.
Troops had been based in the complex since January when a military-backed interim administration took power following months of political violence.
"What started off as spontaneous protest by students had regrettably been taken over by politically motivated elements"
Bangladesh newspaper Daily Star
The government shut down the army camp on Tuesday night after the clashes.
Fakhruddin said: "The steps taken were temporary measures to protect lives and public and private properties as vested quarters had started acts of anarchy in Dhaka and other places."
Aside from imposing a curfew and putting security forces into the streets, the government has closed down universities and colleges in six cities including Dhaka until further notice, telling students to vacate dormitories.
The country's leading newspaper, the Daily Star, said: "The government for its part could no longer remain a passive bystander to the turmoil.
"What started off as spontaneous protest by students had regrettably been taken over by politically motivated elements."
Dhaka University's 40,000-strong campus was deserted on Thursday, with police and troops patrolling nearby streets and no visible protests, witnesses said.
The government warned stern action would be taken against troublemakers, and asked the media not to publish or broadcast "provocative news or footage" that could incite more violence.
Bangladesh has already been under various emergency rules since January when the interim government took charge. It promised to hold a free and free election by end of next year, after completing a drive against corrupt politicians.
Kawsar Khan Sumon, a journalism student at Dhaka University, said: "The protests were spontaneous, but on the third day it spread among a section of the public under the apparent instigation of some political activists."
Students played a key role in previous political movements but the government has said it planned to ban student politics, or at least prevent students from working for the major parties.
That angered both the students and many teachers, education officials said, while the political parties have also supported them and repeated calls for an immediate end to a nationwide ban on political activity.