A Boston police officer fired five years ago for nearly choking an unarmed man into unconsciousness and then dismissing it to investigators as a “bear hug” can return to work with full back pay, the state’s high court ruled.

The Supreme Judicial Court affirmed an arbitrator’s 2013 ruling that officer David C. Williams did not use excessive force when he placed an off-duty Middlesex deputy sheriff in a chokehold.

Williams, the arbitrator found — and the SJC concurred yesterday — was wrongfully terminated in January 2012 by then-Commissioner Edward Davis.

The high court faulted the city for not spelling out in its own rules that chokeholds are a prohibited use of excessive force, saying that if they had, “an arbitrator who found a choke hold reasonable would have exceeded his authority.”

Williams, 54, joined the department in 1991. He has not returned to the job since his termination, as the dispute between the city and the Boston Police Patrolmen’s Association ran its legal course.

This is the second time he’s been off the job for allegations that he used excessive force. The last time, he returned to work with a reported $500,000 in back pay after a 1995 near- fatal beating of a plainclothes officer mistaken for a murder suspect. His pay due now has not been announced.

In the latest case, the SJC reports the city settled a federal lawsuit brought by Williams’ accuser, Michael O’Brien, for $1.4 million.

O’Brien, then 28 and from Burlington, had spent the weekend in the city with friends in March 2009 celebrating his bachelor party and St. Patrick’s Day.

The incident with Williams occurred after one of O’Brien’s friends was in a traffic accident in the North End and O’Brien began filming responding police with his cellphone and struggling with Williams’ partner, who was attempting to arrest him on public disturbance charges.

Attorneys for the city argued in their brief before the SJC that chokeholds are “a potentially lethal use-of-force for which BPD officers are not trained.” Williams, they said, “violated BPD rules requiring the least amount of force necessary in making arrests.”

O’Brien, according to court records, nearly lost consciousness while confined by the chokehold. He filed a complaint within days of the incident with BPD’s Internal Affairs Division; however, the SJC said “little investigation was done.”

Two months later, the complaint was withdrawn.

Police Commissioner William B. Evans said yesterday he respects the decision of the court, “but am deeply concerned about the impact this decision has on (his) ability to terminate employees who have committed significant misconduct. The decision to terminate an employee is never made lightly or arbitrarily and is only done after careful examination of all the facts and circumstances involved.”