FILE - In this May 17, 2015 file photo, authorities investigate a shooting in the parking lot of Twin Peaks restaurant in Waco, Texas. Law enforcement did nothing on the day to stop a meeting in Waco, Texas in 2015 that erupted into the deadliest shootout between biker gangs in U.S. history, even though they had detailed advance intelligence that the encounter between the Cossacks and Bandidos was likely to turn violent, according to a review by The Associated Press of a trove of evidence compiled by prosecutors for use in state trials of 154 bikers. (AP Photo/Jerry Larson, File)

FILE - In this May 17, 2015 file photo, bikers congregate against a wall while authorities investigate a Twin Peaks restaurant in Waco, Texas, after gunfire erupted between rival biker gangs - Bandidos and Cossacks - at the restaurant. Law enforcement did nothing on the day to stop a meeting in Waco in 2015 that erupted into the deadliest shootout between biker gangs in U.S. history, even though they had detailed advance intelligence that the encounter between the Cossacks and Bandidos was likely to turn violent. That finding came from a review by The Associated Press of a trove of evidence compiled by prosecutors for use in state trials of 154 bikers, with the first trial slated to begin this week of Oct. 11, 2017. (Rod Aydelotte/Waco Tribune-Herald via AP, File)

This image from a May 17, 2015 police video shows the weapons are piled up in the backseat of Waco Police SWAT officer Michael Butcher while he was investigate a shooting between two rival biker gangs at Twin Peaks restaurant in Waco, Texas. Law enforcement did nothing on the day to stop a meeting in Waco, Texas in 2015 that erupted into the deadliest shootout between biker gangs in U.S. history, even though they had detailed advance intelligence that the encounter between the Cossacks and Bandidos was likely to turn violent, according to a review by The Associated Press of a trove of evidence compiled by prosecutors for use in state trials of 154 bikers. (Waco Police Department via AP)

HOLD FOR STORY BY EMILY SCHMALL, This image from a May 17, 2015 police Dash-cam video shows the the scene in a parking lot of Twin Peaks restaurant after a shooting between two rival biker gangs in Waco, Texas. Law enforcement did nothing on the day to stop a meeting in Waco, Texas in 2015 that erupted into the deadliest shootout between biker gangs in U.S. history, even though they had detailed advance intelligence that the encounter between the Cossacks and Bandidos was likely to turn violent, according to a review by The Associated Press of a trove of evidence compiled by prosecutors for use in state trials of 154 bikers. (Waco Police Department via AP)

FILE - In this Jan. 6, 2016 file photo, Jeffrey Pike, the national president of the Bandidos Motorcycle Club, is escorted from the Bob Casey Federal Courthouse in Houston. Law enforcement did nothing on the day to stop a meeting in Waco in 2015 that erupted into the deadliest shootout between biker gangs in U.S. history, even though they had detailed advance intelligence that the encounter between the Cossacks and Bandidos was likely to turn violent. That finding came from a review by The Associated Press of a trove of evidence compiled by prosecutors for use in state trials of 154 bikers, with the first trial slated to begin this week of Oct. 11, 2017. (Melissa Phillip/Houston Chronicle via AP, File)

FORT WORTH, Texas (AP) — Law enforcement officers prepared for war in Waco, Texas, on May 17, 2015.

In parking lots surrounding the Twin Peaks restaurant just off Interstate 35, 16 police officers, including a SWAT team of 11, were poised with assault rifles in five police cars and two unmarked SUVs. Seven state police, some undercover, were inside the restaurant or nearby.

Families were eating Sunday lunch apparently oblivious to the gathering storm, as dozens of armed bikers from the Cossacks poured onto the restaurant patio to confront the most powerful motorcycle gang in Texas, the Bandidos.

When the first Bandidos rolled in, "the Cossacks began coming off the patio. You could see the tension building up instantly," Waco Police Detective Jeff Rogers said in an affidavit that is part of a trove of evidence provided to The Associated Press.

Then the shooting started. A SWAT officer said he saw a biker fire first. But evidence isn't clear who started the deadliest biker shootout in U.S. history that left nine bikers dead and 20 wounded. Police bullets struck four bikers, killing at least two of them. Police arrested 177 bikers and state authorities indicted 154. Jury selection began this week in the first of those trials, against Bandidos Dallas chapter president Christopher "Jake" Carrizal for leading and engaging in organized criminal activity.

Evidence that prosecutors gave to lawyers who are representing the bikers shows local and state authorities had overwhelming intelligence that violence was likely and did little in advance to prevent the meeting. While the strong police presence was aimed at deterring violence, and bikers said they noticed police cars, the uniformed police were mostly on the restaurant perimeter.

The evidence also shows that the Texas Department of Public Safety, which was investigating biker gangs, met three times with Waco police in advance of the Twin Peaks meeting and had "contingency plans," although the document simply called on officers to follow department policy before firing.

Rogers said that he made several calls before the shooting to the restaurant manager that went unanswered. State police Special Agent Christopher Frost spoke to Twin Peaks owner Jay Patel three days before the showdown and asked if the bikers had booked the whole restaurant. Patel said they had reserved only the patio area. Frost warned of "rising tensions" between the groups. Patel said he was expecting about 400 bikers and had hired three security guards. Frost's report of the conversation ended with him asking Patel to let him know if any threats were received, but made no mention of any request to Patel to cancel the booking.

One mystery of that day is exactly when federal authorities arrived on scene. The Drug Enforcement Administration had been investigating the Bandidos since January, 2013.

A senior official closely involved in federal prosecutions of the bikers insisted in an interview with the AP that federal investigators were not aware of the Twin Peaks meeting or of "any impending violence." The official spoke on condition of anonymity because of court cases against the bikers.

A Waco policeman reported that he spoke to an FBI agent at the scene immediately after the shooting. Other federal agents arrived quickly including the DEA, The U.S. Marshals Service, and the Bureau of Alcohol, Tobacco, Firearms and Explosives.

The federal investigation intensified immediately after Waco. Federal agents got approval to wiretap Bandidos national vice president John Portillo a day after the Twin Peaks shootout. Prosecutors later indicted Portillo and former president Jeffrey Pike on racketeering charges, including ordering killings and assaults, and they are scheduled to go on trial next year. Five lower-level Bandidos pleaded guilty to similar charges.

AP reviewed video from surveillance cameras, police dashcams and witness interviews, crime scene photos, contents of more than 100 cellphones and thousands of pages of documents.

The Waco tragedy prompted soul-searching among law enforcement officials nationwide. Two experts on biker gangs who did not work on the Waco investigations, said that unless there is fear of a terrorist attack, authorities have to convince a judge to issue an injunction to stop a public meeting protected by the constitutional guarantee of free speech and assembly.

"I think this was definitely a learning experience where they would probably do more proactive stuff to stop the meeting, even if they'd had to get an injunction," said Charles Falco, a former federal informant on California biker gangs who now trains law enforcement officers.

Jay Dobyns, a retired ATF agent who was an informant on the Hells Angels, said violence between biker gangs sometimes happens even with good advance intelligence and a strong police presence. In 2002, the Hells Angels and the rival Mongols got into a fight at a Nevada casino that resulted in a fatal stabbing and two shooting deaths.

"Did we anticipate problems? Yes. What we didn't know, what no one knew, was where and when that was going to pop off," he said.

Biker gangs are a small but violent problem, according to a 2015 FBI report, with some 44,000 members and associates of a few "outlaw" criminal groups such as the California-based Hells Angels and the Bandidos. The Cossacks are more of "an aspirational club" aiming to gain notoriety, said Donald Charles Davis, a biker club enthusiast who blogs under the name The Aging Rebel.

The animosity between the Bandidos and Cossacks may date from November 2013, when Cossacks started wearing a "Texas" patch on the back of motorcycle jackets — seen as a provocation to the Bandidos.

It came to a head in March 2015, at the small town of Lorena near Waco, when a group of suspected Cossacks beat-up a Bandido with chains and metal pipes. The injured Bandido did not press charges.

Waco detective Rogers learned in April from an informant that the bikers were planning to meet at Waco in May.

Also in April, the FBI reported that the Bandidos discussed "going to war" with the Cossacks at a biker rally in West Texas. Law enforcement warned both clubs there would be a strong police presence. There was no significant violence.

As the Twin Peaks meeting approached, communications became more ominous. On May 1, Rogers warned in an email to a colleague: "the potential for violence is very high."

The morning of the meeting, Rogers was "very nervous," and predicted a "high probability for violence."

The shooting lasted just three minutes but left a scene of carnage.

In a conversation captured by her bodycam, Waco police officer Nicki Stone told a colleague after the shooting, "I really didn't think it was going to end like this."

"I thought that we were supposed to stay back and let them fight this out," she said.