TAIPEI (Reuters) - A court in Taiwan on Tuesday sentenced former president Ma Ying-jeou to four months jail over a leak of information related to national security, legal documents showed, but he vowed to appeal, and could avoid jail altogether by paying a fine.

Slideshow ( 3 images )

In the first conviction in a series of lawsuits against Ma since he left office in 2016, Taiwan’s High Court overturned a lower court’s judgment of not guilty.

“Ma Ying-jeou violated the Communication and Surveillance Act,” it said in its judgment, adding that the punishment for the sections infringed was four months’ imprisonment.

The court found that Ma had leaked information related to national security, and an opposition lawmaker Ker Chien-ming, that should have been confidential.

Ma’s sentence could, however, be avoided on payment of a fine of T$120,000 ($4,019), the court said in a statement, in line with Taiwan law that allows such payments for lighter sentences, instead of going to jail.

Ma told Taiwan media he planned to appeal.

“This case is a type of constitutional lawsuit,” he said. “What I’m fighting for is not just my own rights, but it’s also related to how the authority of Taiwan’s future presidents should not be limited.”

He added, “Therefore I definitely need to clarify this problem, I definitely will appeal.”

A former stalwart of the opposition Nationalist or Kuomintang Party, Ma was Taiwan’s president from 2008 to 2016, ushering in an era of closer ties with mainland China.

China considers self-ruled and democratic Taiwan to be a wayward province to be taken back by force one day, if necessary.

Beijing has taken an increasingly hostile stance over the past two years toward Taiwan, following the election of Tsai Ing-wen of the pro-independence Democratic Progressive Party to succeed Ma.