As my colleague Malia Wollan reports, “Hundreds of police officers in riot gear circled the Occupy Oakland encampment downtown on Monday morning, making arrests and flattening tents.”

The raid is the city’s second attempt to dislodge the protesters, who have been camped outside City Hall for more than a month. Two weeks ago, police officers resorted to firing tear gas and rubber projectiles at protesters who refused to leave the area, badly wounding some, including an Iraq war veteran who was hospitalized with a fractured skull.

The new raid is certain to focus attention once again on the troubled relations between Oakland’s police force and its citizens. It could also further complicate the life of officers who sympathize with the message of the Occupy Wall Street movement, but are charged with the difficult task of dispersing protesters.

In recent weeks, an Oakland police officer named Fred Shavies has found himself wrestling with those contradictions.

After the last round of clashes, some activists in the Bay Area released a video warning Occupy Oakland protesters to “beware of police infiltrators and provocateurs” in their midst.

The video, produced by an activist from Berkeley Copwatch, a group that has been monitoring police officers in the Bay Area for two decades, showed Mr. Shavies and another officer attending an Occupy protest in civilian clothes.

The video’s soundtrack also features audio from 2003 of Howard Jordan, then Oakland’s deputy police chief and now the acting chief, admitting to a police board of review that his department had infiltrated an antiwar group that year to subvert a protest against the Iraq war.

“You don’t need to have some special skill to be able to infiltrate these groups,” Mr. Jordan said. “You know, two of our officers were elected leaders within an hour… of being with that group. So if you put people in there from the beginning, I think we’d be able to gather the information and maybe even direct them to do something that we want them to do.”

Mr. Shavies, who is active on several social media platforms, watched with alarm as the Copwatch indictment of him spread across the Web. Since, in his mind, he was not trying to infiltrate the movement but just working to identify “agitators,” Mr. Shavies decided to defend himself by starting a kind of counteroffensive online.

On Twitter, he mocked the idea that he had been exposed by the filmmakers, who showed him both in uniform and in civilian clothes, by writing: “You’d have thought I was Clark Kent/Superman…. I do wear regular clothes and function in my city when I’m not at work.”

In response to that comment, Mr. Shavies was asked by Josh Wolf, one of the activists who helped make the video, whether he had attended Occupy Oakland protests as a civilian or as an officer. “Both,” Mr. Shavies wrote. “I have worked there and attended the protest,” he said.

Police officers are “a part of the the same 99 percent you are fighting for,” he added. “We have been tasked by the city to do a job that they direct us to do and then don’t stand behind.” He concluded: “I think the notion that someone could ‘infiltrate’ a transparent and essentially leaderless movement is comical.”

Mr. Shavies, who is also a freelance photographer, posted four pictures of Occupy Oakland’s first protest last month on his Tumblr blog. Two days later, he added this quote from another blogger to his Tumblr: “What is Occupy Wall Street? A protest about government corruption and the 1% that owns more than 30%-40% of the nation’s wealth and the effort to transfer power to the other 99% of the country.”

The same day he engaged Mr. Wolf on Twitter, Mr. Shavies also sat down with another Bay Area photographer, Justin Warren, to record a video response to the charge that he had attempted to infiltrate the Occupy movement.

In his video reply, Mr. Shavies discussed his work and said that being accused of infiltrating the protest movement was strange because, “I totally agree with Occupy Wall Street, even to an extent with Occupy Oakland.”

“To me, it hasn’t been a secret,” he also said, of policing the protests when not in uniform. “I’m not exclusively a plainclothes officer, I’m not exclusively a uniformed police officer, I’m not exclusively a citizen of Oakland identifying with the movement.”

Later in the fascinating interview, Mr. Shavies explained how the protests in Oakland, given the city’s history, were “bigger than just money, because it’s about inequality, it’s about police brutality, it’s about so much more. And again, being a citizen of Oakland,” he said, “I identify with the 99 percent, but I also have a job to do.”

Near the end of the video, Mr. Shavies also suggested that just as images of dogs and hoses being used on protesters by police officers in earlier decades had led to those techniques being abandoned, the images of tear gas being hurled at Occupy Oakland demonstrators might force the department to reconsider that tactic.

Soon after the interview was posted on Vimeo, several supporters of the Occupy protests praised Mr. Shavies. On the Think Progress blog, Zaid Jilani wrote: “Shavies’ brave words make him one of the few police officers who has publicly stepped forward to question heavy-handed police tactics and to openly support the 99 percent.”

As if to illustrate Mr. Shavies’ contention in the video that the truth is not black or white but gray, days after his interview with Mr. Warren drew attention away from the video that accused him of being an infiltrator, another clip of him surfaced that complicated his portrait still further.

Carlos Miller, a photographer and blogger, drew attention to footage from 2009 which showed Mr. Shavies shouting obscenities and angrily charging into a television news cameraman to prevent him from filming.

As The San Francisco Chronicle reported later that year, the city of Oakland paid the cameraman $175,000 after he filed a federal civil rights lawsuit accusing Mr. Shavies and other officers of assaulting him and breaking his camera.

To Mr. Miller, whose blog “Photography is Not a Crime,” focuses on police harassment of photographers, Mr. Shavies’s attempt to stop the cameraman from doing his job was inexcusable. But, as The Chronicle explained at the time, Mr. Shavies and the other officers were enraged that the cameraman was trying to film them at an extremely sensitive moment — as they grappled with the news that four of their colleagues had just been shot and killed in the line of duty.

Mr. Shavies did not respond to requests for comment, but if he does contact us after this post is published, we will let readers know in an update.