A war-crimes tribunal in The Hague convicted two former Serbian officials on Wednesday of aiding and abetting war crimes committed in the 1990s wars that ravaged the Balkans, the first time that prosecutors tied high-ranking officials from the wartime government in Belgrade to involvement in conflicts in neighboring countries.

It was the final case to be heard by the international criminal tribunal established by the United Nations to prosecute war crimes, crimes against humanity and genocide in those wars. The verdict capped dozens of trials that followed the bloody breakup of Yugoslavia.

The case, coming nearly three decades after the tribunal was established, was also a coda for the protracted legal struggle to hold to account the architects and perpetrators of the worst bloodletting in Europe since the end of World War II. It was the last chance for prosecutors to tie officials from the Serbian state to atrocities in neighboring Bosnia and Croatia.

Few Serbian officials played as critical a role during the conflicts as the defendants Jovica Stanisic, the former head of Serbia’s state security, and his deputy Franko Simatovic.

The presiding judge, Burton Hall, announced the findings on Wednesday afternoon, saying the court found that the defendants were guilty of running a “joint criminal enterprise” to remove non-Serbs from areas of Croatia and Bosnia and Herzegovina. In so doing, the court found, they created “an atmosphere of terror, arbitrary detentions and forced labor.”

However, the findings were limited in scope, focusing on one Bosnian municipality, and rejected a vast majority of the prosecution’s charges, handing down sentences that fell far short of what prosecutors wanted. Mr. Stanisic and Mr. Simatovic were both sentenced to 12 years in prison, including time served.

The verdict was likely to be appealed, according to legal experts.

Prosecutors said Mr. Stanisic was the second most powerful man in Serbia from 1992 to 1995, when Slobodan Milosevic was president. He was a trusted consigliere and keen strategist who was nicknamed “Ledeni” — Serbian for “ice man.”

Known for his sharp suits and dark sunglasses, Mr. Stanisic presented an image of calm. By contrast, Mr. Simatovic, the head of special operations, was a more effusive man who preferred camouflage uniforms and, according to evidence presented during the trials, could be heard bragging about attacks on villages.

Prosecutors accused the pair of organizing hit squads, permitting the killing of prisoners and signing off on covert weapons shipments. Mr. Stanisic and Mr. Simatovic were charged with creating and running a series of covert operations using brutal paramilitary groups and acting on the orders of Mr. Milosevic.

Prosecutors said that they were part of a criminal conspiracy to force non-Serbs out of large sections of Croatia and Bosnia — a campaign that brought a new term to the grim lexicon of warfare: “ethnic cleansing.”

The tribunal, despite criticism over the length of the trials, has set many important precedents in international criminal law and has provided victims a chance to give voice to what they witnessed and experienced.

The tribunal expanded on the body of international law established at the trials at Nuremberg and Tokyo after World War II. And as other courts followed it, dealing with Rwanda, Sierra Leone and Cambodia, many believe the tribunal provided the momentum for the founding of the permanent International Criminal Court.

In all, the tribunal has conducted more than 80 trials, many with multiple defendants. It has convicted 91 people and acquitted 18, while others have died while in custody in The Hague, at least three by suicide.

More than 100,000 people died during the conflagrations from 1991 to 1995, and about two million people were displaced from their homes.

The tribunal was founded in 1993 in response to the mass atrocities unfolding at the time in Croatia and in Bosnia and Herzegovina. From the outset, it has faced criticism, skepticism and political pushback.

In Serbia, it has effectively been branded as anti-Serb. Across the region, many of those who have been convicted of war crimes are still viewed as heroes. And in Bosnia and Herzegovina, the rulings have done little to repair the deep divisions still tearing at the seams of the divided society.

But the tribunal did establish a robust historical record and made clear that Bosnian Muslims made up by far the wars’ largest group of victims.

Mr. Milosevic, considered the main architect of the Balkan wars, faced a battery of charges. But he died in a tribunal cell in 2006, shortly before the end of his trial.

The trials and convictions of Radovan Karadzic and Ratko Mladic, the supreme political and military leaders of the Bosnian Serbs, were widely viewed as victories for international justice.

They were convicted of the gravest crimes that have come under the purview of the court, and of those that had by far the largest number of victims, including the massacre of about 8,000 unarmed men and boys in Srebrenica, in Bosnia and Herzegovina.

Still, the leaders of Serbia itself — long accused as the main instigators of the wars that accompanied the breakup of Yugoslavia — have largely escaped prosecution. No officials of the Belgrade government during the war are serving time for the atrocities in Bosnia or Croatia.

Some senior Serbian officials have been convicted of crimes in the conflict over the independence of Kosovo in 1999.

Stephen Rapp, a former U.S. ambassador for war crimes issues, said that to end the work of the tribunal “without holding the Serbian enablers of the crimes accountable would have left the tribunal’s task incomplete.”

The closest the court came was in the conviction of Mr. Milosevic’s chief of staff, Gen. Momcilo Perisic, who was sentenced to 27 years for aiding and abetting war crimes in Bosnia and Croatia. But the verdict was overturned on appeal in 2013.

The judges did not dispute the evidence of Serbia’s wartime role, or of its continuous supply of weapons, money, fuel and personnel to its allies in Bosnia and Croatia. But the judges argued that there was no evidence that this extensive support was intended to be used for crimes, rather than for what they deemed to be legitimate war efforts.

Since that verdict was overturned, prosecutors have been struggling to find a way to establish the crucial link that legally tied many war crimes in Bosnia and Croatia to the Serbian State Security and by extension to its boss, Mr. Milosevic.

It has been more than three years since the International Criminal Tribunal for the Former Yugoslavia in The Hague closed, and the successor institution, the International Residual Mechanism for Criminal Tribunals, was the official venue for the last trial.

Like many war crimes trials, the case against Mr. Stanisic and his deputy has been complex and drawn out, stretching back to their indictment in 2003. The two men were acquitted at a trial in 2013, but appeals judges, finding fundamental legal and factual errors, overturned that verdict two years later and ordered a full retrial.

Wayne Jordash, the defense counsel for Mr. Stanisic, called the prosecution’s case “flimsy,” and said it was filled with wild overstatements and driven by a poor understanding of the war.

“It does not make sense that Stanisic was both Milosevic’s right-hand man, as the prosecution says,” Mr. Jordash said, “that he is negotiating with international envoys, helping to release captured U.N. peacekeepers, and yet messing around with dirty paramilitaries that were looting and drinking and causing trouble.”

The prosecution relied on dozens of witnesses, scores of videos and radio and telephone intercepts to try to establish that the two men were part of an organized conspiracy that orchestrated the forcible and permanent removal of the majority of non-Serbs from parts of Croatia and Bosnia.

Prosecutors introduced newly obtained records from Serbian secret police archives, which included details about the paramilitary recruits and payments to them. Payments to a group called the Red Berets were signed by Mr. Simatovic.

The secret records were provided by Belgrade, and prosecutors said that they showed that these groups — with names like Arkan’s Tigers, the Scorpions, the Gray Wolves and the White Eagles — were not informal bands of criminals or men who spontaneously took up arms, but well-trained, well-equipped and well-paid men in uniforms, directed by the secret police led by Mr. Stanisic and Mr. Simatovic.

Prosecutors said that these groups were tasked with doing the dirty work during ethnic cleansing operations.