An undercover California Highway Patrol officer who was widely photographed after drawing his gun in an apparent panic while working at a protest in Oakland Wednesday did so because "he didn't know if he was going to make it out alive," a CHP spokesperson said Thursday night.

As we told you yesterday, pictures of the undercover police officer at Wednesday's Oakland demonstration were widely tweeted yesterday, with many asking the Oakland Police department to explain the situation. According to OPD, however, the cop wasn't theirs — instead, he was a CHP officer there to provide "Safety, Service, and Security," as per their motto.

Speaking to reporters Thursday, CHP Golden Gate division Chief Avery Browne said that the undercover officer, a detective in the agency's auto theft division, had obscured his identity with a hat and bandanna over his face as another CHP officer and he walked through Oakland with about 50 protesters at around 11:30 Wednesday night.

That's when demonstrators apparently recognized the two men as police officers, witness and photographer Michael Short tells the Chron:

"Just as we turned up 27th Street, the crowd started yelling at these two guys, saying they were undercover cops...Somebody snatched a hat off the shorter guy’s head and he was fumbling around for it. A guy ran up behind him, knocked him down on the ground. That guy jumped backed up and chased after him and tackled him and the crowd began surging on them," Short said.

According to Bay City News, via ABC7, "Witnesses said it appeared the officer pushed the protester, who responded by ramming his body into the officer. Browne said one of the demonstrators pulled the hood off one of the officers and punched him in the head."

"The officer tackled the man to the ground and handcuffed him. The crowd, incensed, began to gather around them. One woman ran up and kicked the arresting officer in the head as he was handcuffing the demonstrator, Browne said."

“The other taller guy had a small baton out...But as the crowd started surging on them, he pulled out a gun,” Short told the Chron.

According to Browne, the two officers were terrified after being found out. “'Chief, I didn’t know if I was going to make it out of this thing alive,’” Browne said the now Twitter-infamous detective told him.

“'They were coming after us, they had already punched my partner in the head. I didn’t know if we were going to make it out alive,’” Browne says he was told.

According to the Chron, the man accused of punching the officer was booked into county jail on suspicion of felony assault on a peace officer. The woman who kicked the arresting officer in the head was not detained.

Though Brown asserted that the officers displayed their badges and identified themselves as law enforcement as the conflict erupted, both the Chron and BCN report that that's disputed by the many witnesses to the incident.

"We're looking into the use of force," Browne told reporters Thursday. "We understand that it's upsetting, it's disturbing any time a weapon is displayed, so we look into those situations very carefully."

Despite the ongoing investigation, the officers involved in the conflict remain on active duty, Browne says. He refused to identify either of the officers involved in the incident.

Browne says that CHP has had undercover officers marching in every protest since the first one on November 24.

"We put plain-clothes officers in the crowd to listen and gather information," he said.

"We have discovered that individuals who want to commit criminal acts are texting, they're tweeting, and communicating to other people in the crowd, trying to incite the protest."

According to the Chron, however, "Several protesters took to Twitter to say that the officers had actually instigated acts of vandalism and were banging on windows alongside others."

According to Browne, despite Wednesday's incident, as long as the demonstrations continue, his officers will continue to dress up like protesters and march alongside them.

“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 said.

Previously: Undercover CHP Officer Draws Gun During Oakland Protest Confrontation [Updated]