A Korean Canadian pastor who had been detained in North Korea for two years and seven months was released on Wednesday over health reasons, a North Korean news agency reported.

“Rim Hyon Su [Lim Hyeon Soo], a Canadian civilian, was released on sick bail according to the decision of the Central Court of the DPRK on August 9, 2017, from the humanitarian viewpoint,” North Korea’s official news agency KCNA said.

Canada’s Prime Minister Justin Trudeau confirmed the release on Thursday, saying he was “pleased and relieved” that Lim will “soon be reunited with his family and friends in Canada.”

“Pastor Lim’s health and well-being remain of utmost important to the Government of Canada, and we are working to ensure that he receives any required medical attention,” Trudeau said in a statement.

Rev. Hyeon Soo Lim, 62, was detained in December of 2015 when he was in North Korea on one of his numerous humanitarian trips. He was sentenced to hard labor for life for committing “crimes against the state.”

According to his family, Lim had been to North Korea more than 100 times.

“We are relieved to hear that Reverend Lim is on his way home to finally reunite with his family and meet his grand daughter for the first time,” Lisa Pak, a spokesperson for Lim’s family, told CNN. “There is a long way to go in terms of Reverend Lim’s healing. Therefore, in the meantime we ask the media for privacy as he reconnects with his loved ones and receives medical attention.”

“We want to thank the global community for the continued prayers and support and we also ask that the world does not forget the people of North Korea,” her statement continued.

Since Lim, who formerly led Light Presbyterian Church in Toronto, was detained, the Korean community in numerous locations held multiple prayer gatherings for his release, including in Canada, the U.S., and South Korea.

Lim’s release came soon after a high-level official from Canada visited North Korea on Tuesday, hoping to intervene in his case.

“This is a truly joyous occasion,” Suzanne Scholte, the chair of the North Korea Freedom Coalition, told the International Christian Concern, a human rights organization focusing on persecuted Christians.

Meanwhile, Lim’s health condition is currently unclear. Prior to his release, Lim’s family expressed concern for his health as he was known to have lost a significant amount of weight, and to have complained of stomach pain.

Lim also has had high blood pressure, and his family was able to send him medication. However, Canadian Senator Yonah Martin expressed concern that Lim was not receiving the medicine “in the way he should,” according to Reuters.

This report was updated on Thursday, August 10, 2017 at 10:38 AM PST to include the confirmation from the Canadian government.