The events that led to the serious-injury assault began about 10 a.m. Monday, when transient Daniel Moses Cook, 42, allegedly robbed a Dollar Tree store at a strip mall in the 700 block of Fletcher Parkway in El Cajon, according to police. Following the crime, the thief went to a nearby KFC and began stealing soft drinks from a soda fountain there, Lt. Rob Ransweiler said.

After the assailant finally stopped beating the officer and left the area, a Metropolitan Transit System employee who had witnessed the attack used the victim's radio to call for help.

"Since the downed officer was alone, it may have taken much longer to get medical aid to him if it were not for the quick thinking and willingness to get involved of this good Samaritan," Ransweiler said.

Medics took the officer, a 28-year law enforcement veteran, to a hospital for treatment of extensive injuries.

Cook remained defiant until police shocked him into submission with an electric stun gun and took him into custody without further incident.

Cook -- who allegedly was carrying methamphetamine and drug paraphernalia at the time of his arrest -- was booked into San Diego Central Jail. Thursday, he pled not guilty to attempted murder, robbery and drug charges.

Prosecutors say Cook faces 62 years to life, if convicted. He has two previous felony convictions -- including assault with a deadly weapon and robbery.

A preliminary hearing is scheduled for August 2nd. Cook's bail is set at $500,000.