Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A top court ruled Thursday that South Koreans can now legally reject their mandatory military service on conscientious or religious grounds without punishment.

The decision by South Korea's Supreme Court is expected to affect the cases of more than 900 conscientious objectors on trial, as hundreds of men, mostly Jehovah's Witnesses, are imprisoned every year for refusing to serve.

One of the ways South Korea copes with potential aggression from its neighbor and traditional enemy of North Korea is to force all able-bodied men to serve two years in the military.

But under President Moon Jae-in, who was elected last year, South Korea appears to be building bridges with its northern neighbor.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The court broke with its own 2004 verdict that said rejecting military service because of religious faith was illegal. At the time, it decided that the confrontation with the North made South Korea's draft an indisputable necessity.

Thursday's ruling will be welcome news for those who call for greater individual rights and freedom of opinion in South Korea, though others will criticize it for being too soft on what they see as North Korea's ongoing threat.

Oh Seung-hun, top center, speaks to the media in Seoul, South Korea, after Thursday's verdict. Ahn Young-joon / AP

It revolved around the case of Oh Seung-hun, a conscientious objector who had been sentenced to 18 months in prison. The Supreme Court quashed this sentence by a lower court and ordered it to review its verdict.

The majority opinion of a panel of Supreme Court judges is that "conscientious objection of military duty ... can be a valid reason" to avoid military service, the top court said in a statement.

Since the 1950-53 Korean War, South Korea sent about 19,350 Jehovah's Witnesses to prison for refusing to serve in the military. In recent years, about 500-600 Jehovah's Witnesses went to prison every year and spent 18 months behind bars on average. According to the group and the Supreme Court, Thursday's ruling won't apply to 96 Jehovah's Witnesses currently in prison.

The South Korean office of Jehovah's Witnesses hailed the ruling as a "historic verdict that will be remembered for a long time for showing the matureness of the country's human rights awareness."

"This verdict was possible thanks to the patience of my predecessors and colleagues totaling some 20,000 people," Oh told reporters, according to Yonhap news agency. "I hope there will also be forward-looking and positive rulings in about 930 pending cases too."

Oh said he'll try to conduct an alternative form of civil service. The South Korea Constitutional Court ordered the government to provide such a program by 2019.

South Korea's Defense Ministry has yet to come up with the details. In 2007 it had considered allowing conscientious objectors to work in special hospitals and take care of people who had disabilities or dementia.