In a confusing turnaround of its carrot-and-stick diplmacy in the area of human rights, the Carter administration has decided to withhold economic aid - while approving military assistance - to a country accused of rights violations.

Approval of a $12-million economic aid package for Nicaragua was deferred indefinitely last week by the State Department, pending evidence of long-range improvement in the human-rights policies of Nicaraguan President Anastasio Somoza.

At the same time, the State Department decided to sign a $2.5 million military assistance agreement with Nicaragua.

U.S embassy officials here are confused by the apparent contradiction over whether Washington considers the human-rights situation here to be better, as the military assistance approval implies, or not, as indicated by the economic aid deferral. Sources here described Nicaraguan officials, who have not yet been officially informed of the decision, as "dismayed."

While the Carter administration has withheld military assistance to recipients accused of human-rights violations, it generally has continued to fund economic aid programs on the grounds that they benefit the "neediest" people.

The Nicaragua case is the first under this administration where military assistance has been approved while economic aid is held up.

Economic aid programs for other countries in Latin America and Africa have been held up periodically for human-rights reasons but the Nicaraguan program, which consists of loans and grants for two projects in education and nutrition, was the only one left unsigned at the end of the 1977 fiscal year last Friday. Both grants ordered in the Nicaraguan situation were under the fiscal 1977 budget.

State Department sources in Washington said that no policy change was involved, but acknowledged that the situation could be interpreted in several different ways.

"It does appear, no question about it, that the military agreement has taken precedence" said one well-placed source.

But another source close to the decisions, made by an inter-agency State Department group headed by Deputy Secretary Warren Christopher, said that "on the basis of our reasoning, we thought it was the right thing to do."

Regardless of the reasoning, the decisions are likely to bring renewed criticsm from both sides of the human-rights issue in Congress and from pressure groups that the substance of Carter's human-rights policy has yet to take shape.

At the least, the Nicaraguan situation points out the difficulty of applying hard-and-fast rules to that policy.

State Department sources explain the apparent contradiction as both a function of the rules of the aid game - the difference between the ways military and economic assistance are approved - and the administration's desire to retain maximum flexibility in applying human-rights pressure in an atypical situation.

Bilateral economic aid projects requested for a certain fiscal year by the agency for international development can be deferred into the next year without necessarily killing the projects. Thus, if a project is not signed this year, it is simply added to those proposed in the future.

Military agreements, primarily in the form of cheap credit to purchase U.S. weapons, are irrevocably cancelled if they are not signed by the fiscal deadline. Even if the administration signs, however, it still has the option of not approving individual sales and disbursements in the agreement as they are requested.

Both the 1977 economic and military agreements for Nicaragua were under constant administration review this year. During congressional hearings last April, the State Department testified that the administration was aware of "brutal and at times harshly repressive tactics" used by the Nicaraguan National Guard to maintain order.

Signing of the 1977 credits, the department said, was being withheld until the human-rights situation improved.

A glimmer of improvement came less than two weeks before the Sept. 30 deadline. On Sept. 19, Somoza lifted a state of siege that had suspended civil liberties here since 1974.

While the State Department wanted to applaud the move, sources said, it did not want to commit itself to aiding Nicaragua until there was "confiremation of a positive trend" of respect for human rights.

With little time to judge such a trend, sources said that State Department decided to sign the military agreement - allowing itself the option to refuse specific credits in the future - and to defer the economic aid - with the implicit option of approving it when it discovered evidence of a positive rights trend.

The logic behind the move, State Department sources argued is readily apparent to anyone who has all the facts of the situation. Other sources, however, offered a different interpretation.

Nicaragua has a number of friends in Congress, as shown during a heat 1 floor debate in the House last June over a proposal to cut the Somoza government out of all military legislation for 1977, thus effecitvely taking the issue out of administration hands.

Approved in committee, that proposal was dropped in the floor vote. Congressional foes of Nicaragua maintain that Somoza's supporters, led by Rep. Charles Wilson (D-Tex.) and influenced by a heavy Nicaraguan lobbying effort, subsequently pressured the State Department into signing the military appropriation they had fought so hard to win.

Congressional criticism from the Somoza supporters of an unsigned, and forever dead, military agreement, this interpretation goes, was likely to be louder than criticism from Somoza's opponents by an unsigned, but still potentially viable, economic agreement.

State Department sources deny that scenario, however, and maintain that, while congressional input was received on both sides of the issue, the administration made its own decision.

While the debate in Washington continues, U.S. officials in Managua say they have few clues as to what is going on in the State Department.

"We knew the (economic) program was under review," said one. "But in view of the improvements in the human-rights situation," no one here doubted the program would be approved.

"If I had to pick out two projects in the AID portfolio that benefit the neediest people in Nicaragua," the official said, they would be the delayed economic and the projects involved loans and grants for material and technicians to build rural schools and developnew dietary supplements.

The Nicaraguan government, which was scheduled to contribute another $17 million to the two projects, has already hired a number of consultants and has made an "overall investment of several hundred thousand dollars," the official said.

While acknowledging that the program requests will be carried over for additional discussion in the current fiscal year, the official said that AID had already requested an additioned $12 million for fiscal 1978 for Nicaragua, and expressed the fear that those new programs, or ones proposed in 1979, could be cut if the 1977 requests are eventually approved.