Meanwhile, fierce battles in the north between government forces and Tamil Tiger separatist rebels killed 13 guerrillas and two government soldiers, the defense ministry's media center said in a statement.
Human rights groups and ethnic Tamil politicians have accused government forces in the capital, Colombo, and its suburbs of indiscriminately arresting more than 2,000 Tamil civilians after bombings blamed on the Tamil Tigers killed 20 people last week.
After meeting Monday with the relatives of some of those detained, President Mahinda Rajapaksa ordered police to release all those who were being held but not charged with a crime, the president's office said in a statement.
By Tuesday afternoon the government had released all but 202 of the 2,554 people detained in the security sweep, said Cabinet minister Jeyaraj Fernandopulle.
About half those still in custody will be released after they can show identification, while the other half were suspected of involvement in terror activities, Fernandopulle said.
"This is not an action taken against a minority. This is about security and the government safeguarding people in the town," Fernandopulle said.
Tamils have repeatedly complained that they were being singled out by the Sri Lankan security forces, which are dominated by the country's majority ethnic Sinhalese.
Fernandopulle disputed their claim, saying a few Sinhalese and others had been detained.
Kanagalingam Sivajilingam, a lawmaker for the Tamil National Alliance party, said he knew of only one or two non-Tamils being arrested in the crackdown.
"They are desperate, and they think every Tamil is a terrorist ... that's why they are doing random arrests," he said. "We are very angry. People are so angry."
A coalition of local rights groups condemned the detentions in an open letter to the government.
"The arbitrary nature of the arrests have been made clear in cases where almost entire families have been taken into custody," the letter said.
In many cases, those arrested where not told why they were detained and their relatives were not informed a violation of presidential guidelines, according to the letter, signed by 12 groups including the Center for Policy Alternatives and the International Movement Against Discrimination and Racism.
Amnesty International said Tuesday it was deeply concerned that "the arrests have been made on arbitrary and discriminatory grounds using sweeping powers granted by the emergency regulations."
The regulations, which Parliament must renew each month, give the military and police wide-ranging powers to arrest terrorist suspects and detain them indefinitely.
In June, authorities rounded up hundreds of Tamils staying at Colombo hostels, and expelled them from the capital. Following an international uproar, the government let them return two days later.
The Tamil Tigers have fought since 1983 for an independent Tamil homeland in Sri Lanka's north and east following decades of discrimination under successive Sinhalese-dominated governments. More than 70,000 people have been killed in the conflict.
On Tuesday evening, a group of army commandoes and rebel fighters waged a shootout deep in government-held territory in the southeast, said military spokesman Brig. Udaya Nanayakkara. He said four rebels and one soldier were wounded.
Though fighting has long been largely concentrated in the north and east, the Tamil Tigers have recently mounted attacks in the Sinhalese-dominated south.
The attack Tuesday took place about 30 kilometers (20 miles) north of the Yala wildlife park, a popular tourist destination where rebels killed seven soldiers in an ambush in October.
The commandoes, on a mission to find rebels believed hiding in the jungles, opened fire on the group, Nanayakkara said.
Fighting across the north, where the Tamil Tigers control a de facto state, has intensified in recent months.
Russian Foreign Minister Sergei Lavrov stated that Vladimir Putin and Donald Trump, as well as the military of the two countries, will never let a military confrontation spark, but...
An attack is under way against the truth-seeking social media practising data democracy. What is unacceptable is that the liars accuse the truthseekers of lying
On April 20, Russian Foreign Minister Sergei Lavrov confirmed that Russia could supply air defense systems to Syria