Chinese President Xi Jinping is to visit North Korea on Thursday and Friday. (File)

Chinese President Xi Jinping has written a rare opinion piece in North Korea's official newspaper Wednesday, just a day before his scheduled visit to Pyongyang, saying Beijing's friendship with the isolated North is "irreplaceable".

Xi is to visit Pyongyang on Thursday and Friday at the invitation of North Korean leader Kim Jong Un.

The visit comes as nuclear negotiations between Kim and US President Donald Trump have soured after a second summit in February broke up without a deal, failing to agree on what Pyongyang would be willing to give up in exchange for sanctions relief.

In the op-ed piece in the Rodong Sinmun -- the official mouthpiece of the North's ruling Worker's Party -- Xi said Beijing is willing to make a joint plan with Pyongyang to achieve "permanent stability" in the East Asian region.

"We will actively contribute to regional peace, stability, development and prosperity by strengthening communication and coordination with North Korea and other relevant parties to make progress in talks and negotiations on the issues on the Korean Peninsula," Xi said in the piece.

China and North Korea have worked to improve relations in the past year after they deteriorated as Beijing backed a series of UN sanctions against its Cold War-era ally over its nuclear activities.

The trip by the leader of the North's key diplomatic ally and main provider of trade and aid has long been awaited, and comes after Kim travelled to China four times for meetings with Xi.

It will be the first trip to Pyongyang by a Chinese president since Hu Jintao went in 2005.

In the op-ed, Xi stressed that this year marks the 70th anniversary of Beijing-Pyongyang relations, and said their friendship only gets stronger as time passes.

"Over the past 70 years we (North Korea and China) have been unyieldingly advancing forward on the same boat, breaking through rain and wind," Xi wrote.

"One can say this friendship is irreplaceable even with millions of fortune".

The timing of Xi's visit is likely to raise eyebrows at the White House as it comes one week before the G20 summit in Japan, where Trump expects to meet with Xi to discuss their protracted trade war.

Analysts say that Xi's journey is intended as a signal to Trump of his influence and backing for Kim.