SHANGHAI, DEC. 21 -- A Chinese student who was active in Chinese prodemocracy movements here and in the United States was convicted today by a Shanghai court of "counterrevolutionary" activities and sentenced to two years in prison.

Yang Wei, 32, also was sentenced to one year's deprivation of political rights, the official New China News Agency reported. Foreign reporters were barred from attending the trial, which was completed in less than eight hours today at the Shanghai Intermediate People's Court.

Yang's lawyer, Li Guoji, said time already served will count toward the two years.

Yang, who holds a master's degree in molecular biology from the University of Arizona, was arrested in Shanghai Jan. 10 after participating in student demonstrations for freer speech and democracy late last year. It was the first known arrest of a Chinese student returning from study in the United States, and his case has aroused considerable concern among U.S. officials.

In the view of some Chinese observers, authorities may be hoping to use Yang's case as a way to blame last winter's protests on outside agitation and also to use him as an example to deter further protests.

U.S. officials said their concern stems from limits on the political freedoms of Chinese students returning home after study in the United States.

In October, Congress passed a joint resolution, proposed by Sens. Jesse Helms (R-N.C.) and Dennis DeConcini (D-Ariz.), calling for Yang's immediate release. The treatment of Yang and his family "is frightening to all Chinese students now studying in the West and meant to be so by Chinese authorities," the resolution said.

{In Washington, State Department officials said they had no information on the sentence, but earlier in the day they issued a statement deploring the barring of foreign observers from the trial.}

An estimated 19,000 Chinese students from the mainland are studying in the United States, including Yang's wife, Che Shaoli.

{Che, a graduate student in immunology at the Baylor College of Medicine in Houston, called her husband's sentence "unfair." Yang's parents, both officials in Shanghai, and his lawyer attended the trial. Che said her husband intends to appeal the conviction.}

Che has said her husband distributed posters during last winter's demonstrations, and other Chinese sources said Yang had connections with the China Spring democracy movement that was suppressed by the authorities in 1978-79.

According to unofficial Chinese sources, Yang acknowledged today that he wrote articles for the dissident magazine China Spring and distributed leaflets prepared by the Chinese Alliance for Democracy, the New York City-based group that publishes the magazine.

But Yang, speaking in his own defense, said he broke no laws.

The alliance seeks to promote democracy and human rights in China and has called on Beijing to renounce its claim of the primacy of the Communist Party.

More than 150 Chinese students and scholars from approximately 50 universities in the United States issued an open letter last Friday to party chief Zhao Ziyang accusing authorities of violating China's constitution by prosecuting Yang for his views and affiliations.

Today, the court was told that Yang had joined the alliance in 1985, while studying in the United States, and that he wrote articles for China Spring "in which he attacked the people's democratic dictatorship and the socialist system," the agency reported.