China and the European Common Market signed a trade agreement yesterday linking a billion people, almost a third of the world's population.

In a speech at the signing ceremony in Brussels, Chinese Foreign Trade Minister Li Chiang stressed Peking's often-stated view that an alliance with Western Europe can counter the "hegemony" of the superpowers, particularly the Soviet Union.

"We have much in common and should provide each other with mutual support," Li said. "We support Western Europe in its union for strength and in its struggle against hegemony."

Wilhelm Haferkamp, the European Economic Community's commissioner for external relations, responded that the agreement was not directed at anyone. He added that China was a large and receptive market for European technology.

According to EEC figures, the nine member countries imported $960 million worth of Chinese goods, in 1976 while China imported about $1.3 billion worth of Western European products. The volume of trade in 1977 was apparently somewhat lower, according to a U.S. source.

China's main imports from EEC countries are machinery and transportation equipment, manufactured goods and chemical products. In return, it exports raw materials, textiles and foodstuffs.

The EEC is China's second-largest trading partner, after Japan.

Yugoslavia is the only other communist, or "state trading" country, that has signed a trade agreement with the EEC. The Soviet Union, which does not formally recognize the European community, has said it would prefer establishment of relations between the EEC and Comecon, the Soviet bloc's trading group. Talks between the two groups have been held.

Negotiations between China and the EEC formally opened in January, and the trade agreement was initialed the following month. The speed with which the accord was reached is seen by some as a blow to Moscow, which is also involved in disputes with several EEC member countries.

The official Soviet news agency, Tass, has said that a trade agreement between China and the EEC would give Peking "a channel to NATO arsenals" and access to nuclear and electronic technology.

Foreign Trade Minister Li was to travel from Brussels to West Germany.

China has expressed interest in buying weapons from both West Germany and France.

Peking has said it wants to at least double its volume of trade with the EEC.

The five-year agreement signed yesterday commits the EEC and China to giving each other the equivalent of most-favored-nation status. It also requires both sides to try to keep their trade balanced, a clause insisted upon by the Chinese, who had major trade deficits with the EEC until last year.