Israeli Prime Minister Benjamin Netanyahu and his wife Sara speak to Palestinian President Mahmoud Abbas (L) during the funeral of former Israeli President Shimon Peres in Jerusalem September 30, 2016. Amos Ben Gershom/Government Press Office (GPO)/Handout via REUTERS

GAZA (Reuters) - Palestinian President Mahmoud Abbas on Wednesday pardoned a military officer sentenced to a year in jail for criticizing him for attending the funeral of Israeli statesman Shimon Peres, an official said.

A court in the occupied West Bank had sentenced Lieutenant-Colonel Osama Mansour to jail and ordered him dismissed because he had broken a military code of conduct forbidding uniformed officials from expressing political opinions, his lawyer said.

But a senior Palestinian official, who declined to be named, told Reuters: “The president has issued an amnesty decree in favor of Mansour and the officer will be sent into retirement.”

The officer had been held in custody since he posted his criticism on Facebook earlier this month.

While supporters defended Abbas as making a diplomatic and a good-will gesture in attending Peres’s funeral in Jerusalem earlier this month, critics in the West Bank and in the Gaza Strip said he betrayed national principles.

Peres, 93, shared a Nobel prize for interim peace deals with the Palestinians but many social media postings in Arabic focused on a view of his legacy that jarred with his world acclaim as an architect of the landmark Oslo accords in the 1990s.

Peres’s state funeral was attended by U.S. President Barack Obama and dozens of dignitaries from around the world. Abbas’s visit was his first to Jerusalem since 2010.

Before the funeral, Mansour called on Abbas on his Facebook page to reconsider his decision to participate and said it would be “wrong” for the Palestinian leader to attend.

“If it was your decision to take part in the funeral of the killer of our children, you were wrong, and if you made the decision on the recommendation (of your advisers), you were misled,” Mansour wrote.