NAIROBI, Kenya — The Burundians who had fled to neighboring Democratic Republic of Congo had escaped the kind of political violence that human rights investigators have described as crimes against humanity: torture and rape at the hands of the military and the police back home.

But in Congo last week, at least 36 of the Burundians were shot to death in a clash with Congolese security forces after an altercation over the detention of fellow refugees, the United Nations and a local activist said. A Congolese soldier was also killed, and 117 others were injured.

The violent encounter stunned officials and set up a diplomatic row, as the Burundi foreign minister demanded an explanation from Congo, a United Nations official called for an inquiry, and Congolese officials sought to shift blame, questioning whether the Burundians had even been refugees and intimating that they might have been armed.

The United Nations mission chief, Maman Sidikou, said he was “deeply shocked by the high number of civilian casualties who have sought refuge in the Democratic Republic of Congo.” He also said he condemned “all forms of violence between communities.”