Police believe a Miami detective was killed as a man ran through a nearby apartment complex firing his AK-47 in a jealous rage, authorities said Wednesday.

Ricardo Ajuste, 21, has not been charged with Miami police Detective James Walker's death, but was considered the main suspect and was being held without bond. No attorney was listed for him in jail and court records.

Ajuste was arrested early Wednesday on two counts of attempted murder with a firearm because he allegedly opened fire on a couple in a car near Walker's vehicle Tuesday, police Lt. Bill Schwartz said.

He continued firing as he ran through the apartment complex, and Walker was apparently caught in the crossfire, Schwartz said.

Walker was found slumped over the wheel of his unmarked patrol car with his service weapon in his hand, Schwartz said. The weapon had been fired.

An AK-47 was found at the scene. Police were comparing it with bullets taken from Walker's body to see if they matched.

Walker was off-duty and had stopped at the apartment complex to visit his estranged wife, Schwartz said.

Before his arrival, Ajuste "in an apparent jealous rage" opened fire with his AK-47 on a man and a woman inside a car, Schwartz said. The couple fled, and Ajuste ran after them while allegedly continuing to fire his weapon.

Walker likely heard the shots, because he was found with his weapon in hand, Schwartz said. But the detective did not radio for help.

"We think everything happened way too fast," Schwartz said. "Even though he was off the clock, it appears this was a line-of-duty death."

The relationship between the couple in the car and Ajuste was not clear. The man was wounded in the arm, and was being questioned by police as a witness and victim, Schwartz said.

Ajuste is a member of a gang that operates out of the apartment complex, Schwartz said.

A tip led to Ajuste's arrest, police said. Investigators questioned numerous gang members, drug dealers and other sources after Walker's shooting. No listed phone number could be found for Ajuste.

Walker's death is the fourth fatal shooting of a South Florida officer in the past five months. A Miami-Dade County police officer was fatally shot in a shootout with a suspect in September. A Broward County sheriff's deputy was fatally shot in August while looking for stolen vehicles behind a drug store, and another was shot with his own weapon while taking an inmate to court in November.