North Korea said Wednesday it has released a Canadian pastor who was convicted of subversion in 2015 and sentenced to life imprisonment at hard labor.

The official Korean Central News Agency said Hyeon Soo Lim, who it referred to merely as "Rim Hyon Su, a Canadian civilian," was "released on sick bail...from the humanitarian viewpoint."

It said he had been sentenced for having "conducted hostile deeds" against the country.

The development came as a delegation from the office of Canadian Prime Minister Justin Trudeau was in Pyongyang to press for the release of the 62-year-old, South Korean-born citizen, Canadian media reported.

Lim, a pastor with the Light Korean Presbyterian Church of Mississauga, west of Toronto, was detained in February 2015, after having visited North Korea more than 100 times for humanitarian aid and other purposes.

He was reportedly charged with harming the dignity of the supreme leadership, trying to use religion to destroy the North Korean system, disseminating negative propaganda about the country to overseas Koreans and helping U.S. and South Korean authorities lure and abduct North Korean citizens, along with aiding their programs to assist defectors from the North.

In December that year, a court handed down the sentence, which the Canadian government at the time called "unduly harsh," particularly given his advanced age and fragile health.

The release of Lim comes about two months after North Korea released U.S. citizen Otto Warmbier in a coma, who died shortly afterward.

The 22-year-old university student, accused of attempting to steal an item with a propaganda slogan in a staff-only area of his hotel, was convicted for what North Korea said was a hostile anti-state.

The U.S. government subsequently banned its citizens from traveling to North Korea as tourists.

While Canada has not followed suit, its foreign ministry advises citizens against traveling to the country "due to the uncertain security situation caused by North Korea's nuclear weapons development program and highly repressive regime."