PARIS — Appeals judges in an international court have thrown out the war-crimes conviction and 18-year prison sentence for Jean-Pierre Bemba, a former vice president of the Democratic Republic of Congo. It was a blow to prosecutors, who had accused him of condoning the public rape of women and men, the killing of unarmed villagers and the pillaging of property.

The ruling, announced on Friday at the International Criminal Court in The Hague, did not question that the atrocities occurred during a five-month rampage by a militia that Mr. Bemba founded and financed in 2002 to assist his ally, then the president of the neighboring Central African Republic.

But in a 3 to 2 vote, the court found that the trial judges had made a series of legal errors. As a “remote commander,” the court said, Mr. Bemba would have difficulty knowing what his 1,000-fighter militia was doing and adequately investigating and stopping any crimes.

The overturned conviction came as a shock to prosecutors and other court officials. The chief prosecutor, Fatou Bensouda, called the acquittal “regrettable and troubling.” She noted that the judges had not denied that Mr. Bemba’s troops had committed atrocities “which resulted in great suffering in the Central African Republic.”