After two months of apparently agonizing over the decision, the Chinese government announced today that it had decided to bring to trial the copilot of a Soviet civilian aircraft that was hijacked and landed on Chinese territory in December.

Today's statement from a Chinese Foreign Ministry spokesman revealed for the first time that the hijacking of the Aeroflot twin-engine Antonov 24 airliner on Dec. 19 had been carried out by the plane's copilot, identified as Alimuradov Shamil Gadji Ogly. The Soviet news agency Tass stated last year the flight in question had been a domestic one and that the hijacking had been conducted by an armed "criminal." It had not further identified the man.

The trial of the hijacker, the first of its kind to be held here, would be consistent with international law, according to a western diplomat who is familiar with international conventions dealing with hijackings. He said that under international law, the Chinese had a choice of bringing the hijacker to trial or returning him to the Soviet Union.

The Chinese decision to go to a trial seemed to reflect the harder public line China has taken toward hijackings during the past decade. In the early 1970s, a Filipino hijacker was allowed to stay in China without a trial.

On Dec. 25, the Chinese announced that crew members and all passengers of the hijacked Soviet aircraft had been returned to the Soviet Union only a few days after the plane landed on Chinese territory. Many details, including the intended destination of the hijacker, however, have remained unclear. There was speculation that his aim was to fly to South Korea.

The Soviet reaction to the Chinese decision to try the hijacker was not immediately known. Today's Chinese statement did not give a date for the trial.

Diplomats here had assumed that the Soviets wanted the Chinese to return the hijacker to the Soviet Union, but both sides have been discreet in their comments on the subject.

There was no sign that the Chinese decision would have a negative impact on Sino-Soviet relations, which have been improving in the areas of trade and scientific and cultural exchanges during the past year and a half.

Soviet First Vice Premier Ivan Arkhipov is to visit China sometime next month at the head of a Soviet delegation to a Sino-Soviet commission dealing with economic, scientific and cultural relations. It was a visit by Arkhipov to China in December 1984 that appeared to give a major boost to improved relations. The two countries agreed in 1985 to an exchange of visits by foreign ministers, probably to take place in 1986.

But, the Chinese have hardened their line toward the Soviets in recent weeks, accusing Moscow of attempting to "dodge" discussions on ways to remove what the Chinese call the three main obstacles to normal . . . relations between the two countries. These are the Soviet troops along China's northern borders, the Soviet occupation of Afghanistan and Soviet support for Vietnam's occupation of Cambodia.

The Chinese have been scathing recently in their comments on Soviet Vice Foreign Minister Mikhail Kapitsa, who visited Peking in early December. Kapitsa left Peking sounding positive in his comments to reporters. He said that China's Foreign Minister Wu Xueqian would travel to Moscow in May or June and Soviet Foreign Minister Eduard Shevardnadze would go to Peking in the autumn. But the Chinese have insisted that no dates have been set for the exchange of foreign ministers' visits.

According to a western diplomat here, the Chinese felt that Kapitsa was trying to "force their hand."

Diplomats say that the Chinese have been attacking Kapitsa in an unusually direct way in their statements ever since. They let it be understood that if the Soviets continue to refuse to discuss the three obstacles there may be no point to sending Foreign Minister Wu to Moscow.

During the Arkhipov visit to China at the end of 1984, the Soviets agreed to tone down their propaganda attacks on China and informed the Chinese that they were willing to help renovate a certain number of factories that they had built in China in the 1950s. The Soviets stopped attacking systematically the ideological positions of the Chinese. In effect, said one ambassador here recently, the Soviets said to the Chinese: "We don't believe that your economic reforms and open door economic policy will work, but we're not hostile to them. We'll even participate when it comes to a certain number of factories."

"But the Chinese saw that the Soviet concessions went no further than this," the diplomat said. "The Soviets are still a security threat and still encircling China. Truly harmonious relations are not possible at this point.

"The Chinese saw that they were losing their cards one after the other," the diplomat said, "while the Soviets made no further concessions. So the Chinese assumed a tougher position."

Some diplomats believe that the tougher Chinese position is mostly a tactical matter designed among other things to reassure friends and allies that China is not simply making concessions to the Soviets without getting anything in return. In the areas of trade and scientific and cultural exchanges, there is now enough momentum in the Sino-Soviet relationship that it would be difficult to reverse the trend suddenly.

But it was against a background of a hardening Chinese position on the so-called three obstacles that the hijacking of the Soviet civilian aircraft took place. The Chinese were in a position of wanting to show the Soviets -- and the rest of the world -- that they were drawing a line against making further concessions until the Soviets made some of their own. Given this atmosphere, it made sense for the Chinese to oppose any Soviet attempt to obtain the return of the hijacker. The Chinese are saying, in effect, that they will be firm in dealing with the case but that they will deal with it in their own way and in their own time.

The Soviets are likely to be pleased with the firmness of the Chinese but not pleased with having the case taken out of their hands.

One of the ironies of today's decision by the Chinese to deal themselves with the Soviet hijacker is that in another case, when Chinese citizens hijacked a Chinese civilian airliner to South Korea in 1983, the Chinese demanded that the hijackers be returned to China. The South Koreans returned the plane and passengers but refused to return the hijackers. The South Koreans tried them and jailed them for a year but then allowed them to go to Taiwan, their original destination.