A California Highway Patrol officer was gunned down Monday in a shootout off the 215 Freeway, The Los Angeles Times reported.

The Times reported that a man driving a white GMC pickup truck was stopped by an officer on a motorcycle. At some point, the man grabbed a rifle from inside the vehicle and fired at the officer approaching him. Other officers arrived at the scene and witnesses described a chaotic situation. One driver said bullets “flew through their windows.”

"We don't know his motive for this crime," Riverside Police Chief Sergio Diaz said Monday night.

The shooter opened fire shortly after 5:30 p.m. after a CHP officer decided to impound his vehicle.

"He called for a tow truck and was filling out the necessary paperwork" when the driver pulled a rifle from the truck and opened fire, said Scott Parker, assistant chief at the CHP's Inland Division. The officer called for help and three other CHP officers arrived. The officers immediately faced gunfire and two were hit, Parker said.

A Riverside police officer and three Riverside County sheriff's deputies also arrived and traded shots with the man before killing him at the scene, Diaz said.

"It was a long and horrific gun battle," the chief said.

Video showed the gunman, apparently clad in black and wielding a military assault-style rifle, trading fire with officers and then retreating to crouch behind the front of his truck for cover, still trading shots.

Video after the shooting showed bullet holes in the front windows of two patrol cars and large holes blown in their back windows.

Parker said the first CHP officer who was wounded was taken by helicopter to a hospital, where he was pronounced dead. Another officer was hospitalized in critical condition but the third had only minor injuries.

Authorities didn't immediately release the names of the slain CHP officer or the gunman.

However, family members identified the officer as 33-year-old Andre Moye, Jr., who was married and had been with the CHP for about four years, KABC-TV reported.

Police earlier had said at least one civilian had been slightly injured by flying glass.

Two civilians received superficial injuries and "they're going to be OK," Parker said.

Authorities did not immediately say what prompted the officer to stop and impound the truck. Investigators didn't immediately know where the gunman came from or where he was headed, Diaz said.

After the shooting, dozens of law enforcement officers gathered outside of the hospital in nearby Moreno Valley. Snipers were posted on the roof as a precaution.

GET THE FOX NEWS APP

Dozens lined up and saluted as the officer's flag-draped body was removed from the hospital and placed in a hearse. Motorcycle officers then led a procession as the hearse was driven to the county coroner's office.

GET THE FOX NEWS APP

Assemblywoman Melissa Melendez, R-Lake Elsinore, tweeted, “Please say some prayers for the CHP officers involved, according to the report.

The Times reported that the condition of the two officers who were injured was not immediately known.

Fox News' Edmund DeMarche and The Associated Press contributed to this report.