Note to criminals: don’t post pictures of yourself doing anything illegal on Instagram.

San Francisco Police Officer Eduard Ochoa can tell you that. He’s SFPD’s “Instagram Officer.”

“[Instagram] does help us tremendously in obtaining information from suspects,” said SFPD spokesperson Officer Albie Esparza. “They post pictures of illegal activity. Some criminals even brag about it.”

That’s what led to the arrest of a 17-year-old minor who went by the Instagram username “40glock-” and was later charged with two counts of possessing firearms.

Officer Ochoa had been monitoring the minor’s Instagram account after becoming familiar with the minor as well as another man, Marquis Mendez, from prior investigations.

“ “We don’t take [Instagram] lightly. We have an obligation to the citizens of our city to do everything we can to combat illegal activity.” ” — SFPD Officer Albie Esparza

“I saw [appellant] and Marquis Mendez, all possessing a firearm at one point or another in these Instagram photographs. I knew [appellant] was on probation. I knew Mr. Mendez was a wanted felon and a prohibited person,” Ochoa said in a testimony that appeared in the court’s ruling.

The Instagram photos showed the minor, who was already on probation and prohibited from possessing any type of firearm, with a gun tucked into the waistband of his pants.

Based on the Instagram photographs that showed the two suspects brandishing firearms, the officers decided to perform a probation search, where the suspects were detained — still wearing the same clothes they had been wearing in the Instagram photographs that Ochoa had seen earlier that evening.

“So the officer doesn’t just sit there and surf social media,” Esparza said. “We don’t take [Instagram] lightly. We have an obligation to the citizens of our city to do everything we can to combat illegal activity. Anything less would not be acceptable.”

Instagram photos often end up being used as evidence in court.

“If you post something on Instagram and you are posting it online, you’re sort of giving out information to the public,” Esparza said. “Essentially you have no expectation of privacy.”

The threshold for law enforcement to make an arrest is to have probable cause. In a court, the threshold is much higher, which means Instagram comes into play.

“When you have photographic images or video surveillance, you can’t dispute that. It’s there,” Esparza said. “And juries love seeing that evidence, and rightfully so.”

SFPD previously had used social media in identifying a man who smashed the windshield of a Muni bus with part of a barricade after the Giants’ World Series victory in 2012. And SFPD is not the only police department using Instagram. Instagram offers a set of guidelines on its site for law enforcement officials seeking Instagram records.

“If the criminals are getting smarter and more tech savvy, so should the police department,” Esparza said. “We owe it to the city for a safer San Francisco. Instagram is a great tool, and I hope other cities use it too.”