A gang member used an automatic rifle to shoot and kill a member of his own gang in the middle of Baseline Road, police say.

The two alleged gangsters, who had arguments over a woman, were passengers in separate cars on Tuesday morning when 22-year-old Moises Gutierrez grabbed his rifle from the backseat and opened fire on the vehicle behind him, according to police.

The 21-year-old fellow gang member, riding as a passenger in the vehicle behind him, died from the shooting.

By chance, Tempe police say a "federal law enforcement officer" just happened to pull up to the intersection, at 48th Street and Baseline Road, right after the shooting around 6 a.m. on Tuesday, and was able to arrest Gutierrez.

According to court documents obtained by New Times, Gutierrez and others filled in police on what happened.

Police say Gutierrez's girlfriend is the victim's ex-girlfriend. Gutierrez's girlfriend also had a child with the victim.

The night before the shooting, Gutierrez's mom told him that a "suspicious vehicle" drove by their Phoenix home and Gutierrez believed it was the eventual victim.

Tuesday morning, police say, Gutierrez grabbed his automatic rifle and semi-automatic pistol, and his girlfriend drove him over to the victim's neighborhood.

In a moment of apparently bad timing, the victim was outside his house, as he was being picked up by a girl -- under age 18 -- who was coming to give him a ride.

The teenage girl and the victim then followed Gutierrez and his girlfriend out of the neighborhood and onto Baseline Road.

Meanwhile, Gutierrez got into the backseat, loaded his rifle, and aimed it at the car behind him, according to the court documents.

The victim had his head out of the passenger's-side window in the car behind, and was making a waving motion at Gutierrez.

At 48th Street, Gutierrez's girlfriend came to a stop at the intersection, as the car in front of them had yet to take off at the green light. The teenage girl driving the victim, possibly distracted by the rifle being pointed at her vehicle, rear-ended Gutierrez's girlfriend, and when the victim started to get out of the car, Gutierrez started shooting, police say.

A witness to this shooting said the victim had no weapon, there was no weapon found in that car, and Gutierrez eventually admitted that he had no weapon, according to police.

Police say Gutierrez admitted to firing "two to three" shots at the victim.

However, police say there were "at least" five bullets that hit the vehicle -- even on the driver's side, where the teenage girl was. One of the bullets went right through the driver's seat.

Gutierrez admitted that "some of his decisions that day were made out of anger," according to the documents.

Court documents don't identify exactly which gang the men belong to, but police say the victim is a "documented member" of this gang, and Gutierrez was a "self-proclaimed" member. Records indicate that red clothing and a red bandana around the victim's face were "consistent" with this gang's regalia.

Gutierrez told police he and the victim had ongoing disputes about the girl, and claimed the victim had threatened him on Facebook.

Gutierrez was arrested on charges of first-degree murder, drive-by shooting, and aggravated assault with a deadly weapon. His bond was set at $1 million.