Two writers on CBS' upcoming crime drama "Robbery Homicide Division" suddenly found themselves in the midst of a real shoot-out involving the Los Angeles robbery and homicide division.

As part of their research for the new series, writers Jan Oxenberg and Todd Tessler were riding along with two LAPD gang unit officers when they came across a known gang leader, later identified as Mark Castillo, 35. When one of the cops got out of the car, Castillo pointed a handgun at the officers and started firing.

The officers -- Bob Deamer, 40, and Floyd Curry, 33 -- returned fire, and the gun battle began. Curry pursued Castillo on foot while Deamer went after him with the police vehicle, while Oxenberg and Tessler remained in the backseat. The car eventually struck Castillo, who was knocked to the ground. The car then collided with a tree.

Coincidentally, the writers had been interviewing Officers Deamer and Curry about their experience with shootouts when the incident began.

No one was wounded in the shootout, although Oxenberg, Tessler, and Deamer were treated for minor injuries at a local hospital. Castillo was held on $500,000 bail. His handgun was recovered at the scene.

The writers' ride-along was part of a comprehensive training program set up by "Robbery Homicide Division" producers to expose writers and actors to the world of police work. The program, which a spokesman said is voluntary, also includes firearms training and familiarization with the daily routines of police officers.

Universal Television, which produces the series, has discontinued the ride-alongs in wake of the shoot-out.

It's not uncommon for writers and actors to ride with police as part of their research for a show or movie. An LAPD spokesman said he didn't have a list of shows that had taken part in ride-alongs in recent years, but that reporters from virtually all of L.A.'s local news outlets regularly take advantage of the program.

LAPD's robbery and homicide division -- which serves as the setting for "Robbery Homicide Division" -- is now investigating the incident.