Minneapolis police officer William Martin was sifting through a suspected gang member’s Facebook postings last year when one caught his eye: a message arranging a gun sale to someone who was threatening to shoot up a local school.

A little more sleuthing determined the alleged buyer was a 13-year-old area boy, with a history of mental illness who’d had frequent run-ins with his peers and teachers. Within hours, Martin had obtained warrants to search through “hundreds of pages” of Facebook messages, and later the teenager’s house, department officials said. By the following day, the suspect was in police custody, awaiting felony charges for making terroristic threats. Case closed.

The officer’s quick thinking not only unmasked the suspect — who had created a Facebook account under a fake name — but also likely prevented what could have been a mass shooting, officials said in presenting Martin with the Excellence in Investigation award at the department’s annual awards ceremony.

“This was a tremendous amount of work to complete in such a short period of time,” deputy police chief Erick Fors said while introducing the officer.

Martin was among several dozen honorees, both sworn and civilian, who were recognized for going above and beyond the call of duty at the ceremony, held Wednesday night at Ukrainian American Community Center in northeast Minneapolis.

The night was an opportunity to recognize officers and detectives for outstanding performance, dedication and acts of heroism that sometimes go unnoticed among negative press coverage, officials said. Chief Medaria Arradondo also thanked officers’ spouses, children and other relatives for their “sacrifice,” pointing out the toll that the long hours of police work can take on family life.

Councilman Steve Fletcher, co-chair of the Public Safety committee, was the only elected official in the room of several hundred people; Mayor Jacob Frey was on a previously scheduled trip out of town.

The top honor of the night went to 4th Precinct officer Andrew Schroeder, who was named Officer for the Year.

Assistant chief Mike Kjos said Schroeder was the embodiment of the hard-charging, street-savvy beat cop that was making the North Side a safer place, noting his 177 stops of suspicious people and vehicles last year leading to the recovery of 52 guns, tops in the precinct.

“He puts his heart and soul into the professional service that he gets and is committed to building trust in the community,” Kjos said.

Also named the precinct’s officer of the year, Schroeder said in an interview that he was “humbled” by the recognition and credited his mentors on the force with teaching him the nuances of crime investigation. He said he first fell in love with law enforcement in college after going on a ride-along to fulfill a class requirement.

“I do love helping people, but I hate the idea of people preying on other people, of criminals hurting other people and I like stopping that,” said Schroeder, who works the day shift. “The bottom line is I like ending the violence and the hurt that is in the community.”

Sex crimes detective Sgt. Matt Wente was named investigator of the year, officials said, for his professionalism and “positive attitude” after a series of articles by the Star Tribune documenting serious lapses in how police departments across the state investigated allegations of sexual misconduct. The series, titled “Denied Justice,” had, according to officials, “painted the investigative process in a negative light and this could’ve had a negative impact on the unit’s morale.”

Department brass praised officers from the 1st Precinct, which garnered several top awards, including the MStat Recognition Award, for helping lead downtown to “historic” crime drops, despite a recent wave of violence. Notably, robberies — considered a key indicator of how safe city streets are — declined roughly 45 percent from 2017 to 2018, officials said. The precinct’s Community Response Team (CRT), which is tasked with investigating crimes ranging from drug dealing and purse-snatching to prostitution, received the Unit/Division Citation.

Members of the 3rd Precinct CRT unit were also recognized for helping achieve the highest reduction of serious crimes such as homicide, rape and robbery, of any of the five precincts. Precinctwide, such crimes fell about 22 percent between 2017 and last year, while robberies decreased 36 percent and aggravated assaults 10 percent over the same period, officials said. Sometimes working undercover, the unit focused its efforts on crime hot spots identified by computer mapping, including one in the East Phillips neighborhood where officers made 532 arrests last year. As a result, overall crime in the area dropped by nearly seven percent, officials said.

The Gang Interdiction Team was recognized for recovering more than 100 guns off the street last year, while also playing a crucial role in Project L.I.F.E., a cousin of the CeaseFire program being credited with reducing violent crime in parts of the North Side.

Among the civilian honorees were a foster couple who took in four children after their mother was arrested and charged with child abuse and sexual assault, and three men who stopped an attempted rape.