The South African military is withdrawing about 50 peacekeepers from a United Nations mission in Congo because they violated disciplinary codes, a military spokesman said Thursday.

The violations included leaving a base after curfew, Brig. Gen. Xolani Mabanga said.

The troops were deployed in eastern Congo as part of a unit with a mandate to fight rebel groups there, according to a South African military statement.

The statement said the personnel compromised the security of other South African troops and will face military prosecution. It said they violated not only the South African military conduct codes but also those of U.N. peacekeepers.

South African forces have been involved in peace efforts in Congo over the years. In 2013, South Africa announced it would contribute 1,345 troops to the U.N.'s "intervention brigade" in Congo.

The U.N. force's strengthened mandate to fight rebels was credited with helping the Congolese army oust a rebel group known as M23 from the country's embattled east. U.N. peacekeepers first arrived in Congo in 1999 to observe a cease-fire and the withdrawal of foreign troops.