Christian militias stormed a UN base in southern Central African Republic killing a peacekeeper and wounding 11, the United Nations said.
Armed anti-balaka militants attacked the base in Tagbara, north-east of Bangui on Monday, a UN statement said.
The ensuing gunfight lasted hours, and 22 anti-balaka were killed, the statement said.
Later peacekeepers found 21 dead civilians, including four children, near a church. It was not immediately clear who was responsible for those deaths.
“Nothing can justify such acts that can be considered war crimes,” the statement said. “An investigation will be conducted and will leave no room for impunity.”
CAR was torn apart after mainly Muslim Seleka rebels ousted president Francois Bozize in 2013, provoking retaliation killings by the anti-balaka.
A 12,000-strong UN peacekeeping mission has struggled to restore order to the countryside where attacks on civilians are frequent. The UN Security Council approved an extra 900 peacekeepers in November to help to protect civilians.
The mission has become a deadly one with more than a dozen UN peacekeepers were killed last year.