After an unusually sharp behind-the-scenes debate, the AFL-CIO today criticized the Reagan administration's emphasis on the use of military force against Nicaragua's Sandinista government but stopped short of opposing military aid to the antigovernment rebels.

This compromise resolution, adopted here at the labor federation's 30th anniversary convention, masked a strong conflict between union officials traditionally supportive of U.S. foreign policy and those who have been more critical, now and in the past.

Central America, particularly the question of aid to the Nicaraguan counterrevolutionaries, or contras, emerged as the most controversial issue among many of the delegates representing 96 AFL-CIO unions at the convention, who debated -- mostly in private -- the threat of communism and the dangers of possible U.S. intervention.

The debate has been fueled by a group of 20 union presidents who in 1983 formed a committee that visited Central America and issued reports critical of U.S. policies there, which the AFL-CIO has generally supported.

AFL-CIO President Lane Kirkland and other federation officials opposed the committee's actions and sought a compromise resolution that would condemn the Sandinistas for suppressing civil liberties and union activities, but leave open the question of U.S. support for the contras seeking to overthrow the Sandinista government.

More than a dozen resolutions were submitted here by unions opposing contra aid. The United Auto Workers and the American Federation of State, County and Municipal Employees and several other major unions pushed the AFL-CIO to adopt language opposing aid to the contras.

After days of wrangling, the Central America resolution approved today included a compromise statement:

"Unfortunately, the Reagan administration continues to place emphasis on a military, rather than a political, solution to the conflicts in Nicaragua and El Salvador. But the AFL-CIO believes that a negotiated settlement, rather than a military victory, holds the best hope for the social, economic and political justice that the people of Nicaragua and El Salvador deserve."

Kirkland, in an emotional speech, strongly defended the AFL-CIO position as "a liberal resolution that stands foursquare for everything the labor movement stands for."

The AFL-CIO, which long had supported increased defense spending and rarely criticized U.S. military actions during George Meany's tenure as president, has moved slowly toward a posture more critical of U.S. foreign policy, according to union officials.

The AFL-CIO operates five international affairs programs that receive more than $35 million in government funds to promote economic development and foster anticommunist unions overseas. Opponents within organized labor contend that the link between the government and the AFL-CIO has resulted in the federation's supporting right-wing regimes in Central America and the Philippines.

Irving Brown, the AFL-CIO's Paris-based international affairs director, said in an interview that "Mr. Reagan did not create the contras, the oppression by the Sandinistas created the contras." He said aid to the contras should remain a U.S. option to prevent the creation of "a second Cuba."

Between 1981 and 1984, the Central Intelligence Agency funneled $80 million in aid to the contras, but Congress this year passed a $27 million "non-lethal" aid package that bars CIA and Defense Department involvement.

UAW, AFSCME and other unions agreed to the compromise because its wording enables them to continue their strong Capitol Hill lobbying against aid to the contras.

Donald Stillman, UAW's international affairs director, said, "We wanted a much stronger statement, but this moves the federation slowly in the right direction."

Albert Shanker, president of the American Federation of Teachers, said it was important for the AFL-CIO to leave the contra issue open because the threat of U.S. support "could be used a bargaining chip" with the Sandinistas to get them to make changes.

But Edward Asner, president of the Screen Actors Guild, said he reluctantly agreed to support the compromise even though it could allow for support of the contras, which he called "unforgivable."