BELGRADE, Yugoslavia (AP) _ A military court convicted two ethnic Albanian soldiers on charges of organizing a terrorist group to fight for the rights of their minority, an official report said Tuesday.

The court in Sarajevo, capital of the republic of Bosnia-Hercegovina, convicted Rasim Salihu and sentenced him to 5 1/2 years in prison, the state- run Tanjug news agency said. The second soldier, Sejran Hadziju, received a prison sentence of 2 1/2 years, Tanjug said.

The military tribunal said the two conscripts had organized an illegal group of ethnic ''Albanian extremists and separatists'' during their compulsory army service, according to Tanjug.

The report said the group had planned to stage terrorist actions in their army barracks.

Most ethnics Albanians come from the southern Yugoslav province of Kosovo, which for years has been plagued by tensions between its 90 percent Albanian majority and the Slav minority.

About 30,000 Serbs and Montenegrins - who are Slavs - reportedly have left the economically backward region since 1981, when Albanian extremists organized riots to demand greater autonomy. The Albanians say the Serbs, who claim Kosovo as their medieval heartland, are persecuting them and denying them equal rights as Yugoslav citizens.

In another incident Tuesday, six ethnic Albanians were arrested on the Yugoslav-Austrian border while trying to smuggle into Yugoslavia five automatic rifles and a large quantity of ammunition, Tanjug reported.

Yugoslavia, which has about 20 different ethnic groups, is a communist federation of six republics and two autonomous provinces formed after World War II.