As an undercover detective in New York, Wojciech Braszczok's job was to investigate members of Occupy Wall Street. Going by the name "Al," he hung around the group, blended in and was even arrested as a protester. He didn't carry a gun or a badge or identification bearing his real name. On the surface, he wasn't a cop.

"Basically I had no contact with the police department, except for my handler," he testified this week.

But that all ended when he joined a motorcycle ride on Manhattan's West Side Highway in September 2013 that devolved into pandemonium with an SUV driver beaten bloody in front of his family. Now, the 34-year-old is being tried on charges of gang assault and other crimes for his role in the melee that burned his cover and is shedding an unwanted light on how the nation's largest police department cultivates, supervises and protects the identities of officers assigned to undercover duty in criminal probes or surveillance operations.

"The nature of the work is secret, but at the end of the day, you're still a police officer, you have a duty," said Nick Casale, a former officer turned private eye. "You can blow your cover if a crime is about to be committed."

The 35,000-officer department won't reveal how many officers work undercover. But it's believed their ranks are well in the hundreds, if not the thousands.

Supervisors often seek to recruit officers who are tough enough to deal with the stresses of living a double life, and who speak foreign languages or have other skills that would allow them to escape detection in narcotics, gun-trafficking, terrorism and other investigations. In a 2009 internal affairs investigation of a crooked officer dealing drugs out a barbershop he owned, the department found an officer who had cut hair before joining the force and had him rent a chair there.

Recruits are taken off of routine duty and diverted into special training programs, then given a cover name and a cover story. Depending on how deep the undercover assignment, any contact with regular police officers and even high-ranking commanders can end there.

Braszczok was born in Poland and speaks English as a second language. He joined the force a dozen years ago, first on patrol in Queens before he was tapped to work narcotics as an undercover. He made more than 250 drug buys during his time there and was transferred to the department's Intelligence Division — a unit tasked with security for the mayor but that also handles confidential informants and "infiltrates domestic groups who could cause threats to public safety," according to testimony.

He was given a new name, Al Malokovitch, and a new investigative target: members of Occupy Wall Street, the protest movement that swarmed lower Manhattan in 2011 and sparked similar anti-wealth gap movements around the globe. When he was arrested, no one knew he was a cop. His handler, another undercover assigned as his contact to the police world, took care of the arrest.

The handler, known in court only as "Undercover 7047" testified that Braszczok was required to check in at the beginning and end of his shift. And if he witnessed a crime, he had a duty to report it and to get involved if necessary, even if it meant identifying himself as a detective.

"We all have a duty to take action," the undercover testified.

On his day off, Braszczok decided to join in the motorcycle ride, which had nothing to do with Occupy. He texted his handler that it was going to be "mayhem." Prosecutors have suggested Braszczok and the other bikers had made the West Side Highway a personal playground, popping wheelies, slapping car hoods and terrorizing SUV driver Alexian Lien and his wife and toddler, who were headed to New Jersey to shop.

Stopped on the road, Lien says he feared for his life so he drove off, running over a biker. Prosecutors say Braszczok barreled after Lien and was among the bikers who forced the Range Rover to a stop on a side street. The detective eventually drove away while Lien was pulled from the car and attacked on the street.

Braszczok testified that he followed Lien because he wanted to "stop the car from running more people over." When he got off his bike, he intended to tell Lien to stop driving, but he heard a bang and saw the SUV window break, and then started to fear for his safety, so he left.

"I should have called 911, but I didn't," he said. He said he regretted the decision, adding he believed the police were on their way.

The handler said Braszczok should have called in right away to report the incident, but he didn't call for two days, and he didn't come clean that he'd been at the scene of the assault until even later — after helmet-camera videos were posted online.

Braszczok and co-defendant Robert Sims opted to have a judge, not a jury, determine the outcome. Eleven men were indicted in the melee; the others have pleaded guilty to charges including assault and riot and received or are facing sentences ranging from probation to up to four years in prison. Lien was not charged. The biker Lien hit, Edwin Mieses, was paralyzed.

Braszczok is also facing a departmental trial where he could be fired.

__

Associated Press writer Tom Hays contributed to this report.