The melee broke out in North Sumatra province, where more than 100 Rohingya migrants - most intercepted off Indonesia's coast after fleeing their homeland in rickety boats - and 11 Buddhists accused of illegal fishing were being housed together, said local police chief Endro Kiswanto.
He said witnesses told police the clash started early Friday after a Rohingya Muslim cleric and a fisherman got into a heated debate about sectarian violence that erupted last month in central Myanmar when mobs of armed Buddhists torched Muslim-owned homes and shops, killing dozens and forcing thousands to flee.
The argument apparently started after the Rohingya migrants saw photos showing destruction caused by the recent violence, said Yusuf Umardani, detention center chief. Insults were traded, and the cleric was allegedly attacked by a fisherman. When the cleric screamed, his friends jumped in to help. From there, the rumble broke out so quickly, security guards were too late to stop it.
"The violence took place so fast, and it was completely unexpected because they had been living peacefully here so far," Umardani said. "Most of the dead victims suffered severe head injuries. Apparently, they fought using anything that they could get - rocks, wood, chairs and knives."
Eight Buddhists were killed, and 15 Rohingya were injured. Three other Buddhists escaped unharmed, Kiswanto said.
Local police spokesman Col. Raden Heru Prakoso said 18 Rohingya detainees have been named as suspects.
"Our friends were covered in blood," surviving fisherman Win Thike Oo told an Associated Press photographer at the scene. "If we were there at the time, we would also be dead."
About 280 people are crammed into the overcrowded detention center - more than double its capacity. It is filled with a mix of mostly asylum seekers from different countries, including Afghanistan and Sri Lanka.
Boatloads of Rohingya have been washing up on Indonesia's shores following a wave of violence last year in western Myanmar, where they are considered illegal Muslim settlers from neighboring Bangladesh. Hundreds have been killed and more than 100,000 left homeless in clashes between ethnic Rakhine Buddhists and Rohingya.
The tensions have tested Myanmar's fledgling reformist government as it attempts to institute political and economic liberalization after nearly half a century of military rule.
"We actually don't understand about what is happening in my country," said survivor Oo, who has been detained for nine months at the center after being nabbed for illegal fishing in Indonesian waters. "We are only fishermen. We don't care about politics or conflict."
All of the victims from the detention center were rushed to a hospital in the provincial capital, Medan, about 23 kilometers (14 miles) south of the port town of Belawan. The three surviving fishermen have been moved to a separate building and hundreds of police have been deployed to secure the center. A forensics team was working to collect evidence and surveillance recordings were being reviewed.
The UN Refugee Agency issued a statement saying it was saddened by news of the deaths.
"UNHCR is calling for calm among the groups and urging the Indonesian authorities to take action to prevent further violence, including moving individuals into community housing as soon as possible," it said.
Maj. Zaw Htay, the director of the president's office in Myanmar, said the country's embassy in Jakarta has urged Indonesian authorities to investigate and punish those involved.
Associated Press writers Niniek Karmini in Jakarta, Indonesia, and Aye Aye Win in Yangon, Myanmar, contributed to this report.