North Korea freed a Canadian pastor serving a life sentence on humanitarian grounds, the official KCNA news agency said on Wednesday, just hours after the United States warned it would counter any threat from the North with "fire and fury."

There was no clear connection between the release of Hyeon Soo Lim and the heightened rhetoric between Washington and Pyongyang. Canadian officials said on Tuesday a delegation led by the country's national security adviser had travelled to North Korea to discuss Lim's case.

Lim, who served in one of the largest churches in Canada, had been sentenced to hard labour for life in December 2015 after North Korea accused him of attempting to overthrow the regime.

KCNA said Lim had been released on "sick bail" by the country's Central Court for humanitarian reasons.

Lim, accompanied by his wife and son, is expected to return to Canada on Thursday and will be hospitalized on arrival at his wife's request, a source familiar with the matter said.

"So far, it has been confirmed that government officials and a doctor are accompanying Reverend Lim," said the source, speaking on condition of anonymity because they were not authorized to speak to media.

Lim's family had become more concerned for his welfare since the death in June of American student Otto Warmbier, who had been held in North Korea for 17 months. Warmbier, sentenced last year to 15 years' hard labour for trying to steal a propaganda item from his hotel, died in a Cincinnati hospital just days after being released in a coma. The circumstances of his death remain unclear.

North Korea has in the past attracted the attention of Washington and visits by high-profile Americans with the detention and release of U.S. citizens.

North Korea is still holding three Americans. The U.S. State Department said last week it would ban U.S. nationals from travelling to the isolated country, beginning in September.

Lim's Toronto-area church has said he visited the North more than 100 times since 1997 and helped set up an orphanage and nursing home. Last year, Lim told CNN he spent eight hours a day digging holes at a labour camp where he had not seen any other prisoners.

On Wednesday, North Korea said it was considering plans for a missile strike on the U.S. Pacific territory of Guam, just hours after President Donald Trump, unhappy with Pyongyang's nuclear weapons program, told the North that any threat to the United States would be met with "fire and fury."