Korea has suffered a trade deficit with its biggest market China this year for the first time in 31 years.

According to the Ministry of Trade, Industry and Energy on Wednesday, Korea's exports to China totaled $114 billion in the first 11 months of this year, while imports amounted to $132 billion, resulting in an $18 billion deficit. The monthly trade balance began with a $3.9 billion deficit in January and stayed in the red since.

The cumulative deficit this year is the second biggest after a $22.4 billion deficit in trade with Saudi Arabia, the No. 1 oil exporter to Korea.

The only time Korea posted a trade deficit with China was in 1992, when they established diplomatic relations and started to trade. China now account for 25 percent of Korea's total exports.

From 2003 to 2018, China had been the source of Korea's biggest trade surplus, accounting for up to 80 percent of the total trade surplus.

But then trade with Beijing shifted into the red because China no longer imports so many intermediate goods from Korea to make products to sell around the world and now produces its own. But Korea still relies on China for key raw materials for rechargeable batteries and other industries.

Semiconductor exports, which used to account for the bulk of Korea's shipments to China, also declined due to an industrywide slump.

Cho Sang-hyun of the Korea International Trade Association said, "We are now clearly seeing the changing trade dynamics with China, which had been obscured by strong semiconductor exports. A whole new trade framework is needed."

Other reasons for the deficit are growing tensions between Washington and Beijing and China's economic slowdown.