BEIJING, DEC. 26 -- China in 1987 achieved its first trade surplus in four years through restrictions on imports and new incentives for companies to export their products, the trade minister said today.

The official News China News Agency quoted Zheng Tuobin, minister of foreign economic relations and trade, as estimating that China exported $34 billion worth of goods for the year and imported $30 billion.

Exports from January through November were up more than 14 percent over the same period of 1986, he said. Imports fell slightly.

In 1986, China had a trade deficit of $5.7 billion. China last reported a surplus in 1983.

For most of its 38 years under communist rule, China has maintained trade surpluses because of strict central controls over the economy.

In recent years, emphasis on catching up with the developed world has led to heavy imports of modern machinery and technology. World prices for China's traditional exports of raw materials also have fallen.

Zheng was quoted as saying much of the growth in exports has been in finished products, with overseas sales of machinery and electrical products up more than 48 percent over last year.

He said China narrowed its deficit with its No. 1 trade partner, Japan, and ran a surplus in trade with the United States. Exports to Japan rose to $5.4 billion and those to the United States reached $2.6 billion. He did not give import figures.

The United States is China's third-largest trading partner, after Japan and Hong Kong.

China's bilateral trade statistics do not include goods shipped to third countries via Hong Kong, and thus are lower than figures provided by its trade partners.

The U.S. Commerce Department estimated Chinese exports in 1986 at $5.2 billion and imports from the United States at $3.1 billion for a more than $2 billion deficit. It predicted the deficit would reach $3.8 billion this year.

Chinese officials have faced conflicting pressures in their efforts to increase trade. On the one hand, they have striven to reduce red tape and central controls that have driven away many foreign partners.

On the other hand, lessened controls means many Chinese exporters are free to spend the foreign currency they earn on imported machinery and wasteful investment projects.