OAKLAND (CBS SF) — In a photo posted to Twitter, an undercover California Highway Patrol officer is seen pointing a small handgun in a “side grip” style toward a crowd of protesters and a news photographer while he restrains a protester who had reportedly attacked his partner.

Various eyewitnesses indicate protesters somehow discovered the man and his partner were embedded law enforcement and began shouting, and then attacking the officers.

The Tweet embedded below sparked outrage.

Undercover police ARE violent protesters. In Oakland, cop pulls gun (not badge) on crowd after being exposed. pic.twitter.com/nBYc8MurZq — The Dreamkiller (@Eyeslam) December 11, 2014

Also, major props to @MikeShortPhoto, who had a gun pointed at him in Oakland, kept working #berkeleyprotests pic.twitter.com/rMImnkxCdn — Vivian Ho (@VivianHo) December 11, 2014

One critic tweeted, “Undercover police ARE violent protesters. In Oakland, cop pulls gun (not badge) on crowd after being exposed.”

The CHP’s Avery Browne tells the San Francisco Chronicle that plainclothes officers have been in demonstrations for weeks, and will continue in order to avoid more freeway incursions.

“We will use all of the avenues we can to keep the public safe and gather that information so we can be responsive and be in the proper position,” he told the Chronicle.

The photo was captured by a freelance photographer working for the newspaper and website.

Chief Browne added that the unnamed officer did show a badge first, and used his baton before transitioning to his weapon to keep the crowd at bay while waiting for help with the suspect, and his injured partner.

Oakland’s Lt. Chris Bolton responded that “#OaklandPolice [is] unable to provide details which led to the incident & have referred questions to CHP.” Bolton clarified that, “Last night #OaklandPolice responded to a request for help during a California Highway Patrol arrest at Bay & Harrison St. #OaklandPolice PIO is referring all inquiries regarding this incident to the California Highway Patrol.”