An Atlanta police detective testified Friday that surveillance footage captured Chicago rapper Lil Durk firing a weapon from a vehicle near the Varsity parking lot where a man was seriously injured earlier this year.

Lil Durk, whose real name is Durk Derrick Banks, turned himself in late last month in connection with the Feb. 5 shooting outside the popular Atlanta restaurant.

On Friday, he and co-defendant Dayvon Bennett appeared in a Fulton County courtroom for a preliminary hearing, where police testified that robbery was a motive in the shooting.

The 26-year-old rapper faces a host of charges, including criminal attempt to commit murder, aggravated assault, possession of a firearm during the commission of a felony and possession of a firearm by a convicted felon. He also faces a criminal street gang charge, records show.

Rapper Lil Durk appears in court Friday during a preliminary hearing. He's charged in connection with the Feb. 5 shooting of a man outside the Varsity.

Credit: Channel 2 Action News

icon to expand image

Credit: Channel 2 Action News

Atlanta detective Jeffrey Churchill said he spoke to a witness at the scene, who told him she was talking to Banks and Bennett outside a cigar bar when gunfire erupted.

The incident was reportedly captured on surveillance cameras from multiple businesses.

“You see Mr. Banks’ arm out the window firing several shots at the victim,” Churchill said.

RELATED: Rapper Lil Durk booked into jail, charged in connection with Varsity shooting

Police said the shooting occurred just before 6 a.m. outside the restaurant at the intersection of North Avenue and Spring Street.

Atlanta police officers collect evidence after a man was shot in the parking lot of the Varsity.

Credit: JOHN SPINK / JSPINK@AJC.COM

icon to expand image

Credit: JOHN SPINK / JSPINK@AJC.COM

The victim, identified as 23-year-old Alexander Weatherspoon, was shot once in the thigh.

After Weatherspoon was shot, he ran across the street before collapsing in front of the nearby cigar lounge, according to an Atlanta police incident report. He was rushed to Atlanta Medical Center for surgery after the bullet struck his femoral artery, police said in the report.

Officers discovered 13 shell casings from a pistol and a rifle in the parking lot, according to the report. A 9mm handgun was also recovered at the scene.

The shooting was captured on surveillance cameras from the Varsity and the cigar bar, according to investigators.

On Friday, police testified that Banks and Bennett are members of Chicago gangs and that they knew Weatherspoon had $30,000 in cash on him the night of the shooting, which is why he was allegedly targeted, according to Channel 2 Action News.

The man told police his chain and vehicle were stolen after the shooting, detectives said.

Before turning himself in last month, Banks told the news station he was innocent of the charges against him.

MORE: 'I have nothing to hide': Rapper Lil Durk denies involvement in Varsity shooting

He also released a single on YouTube called “Turn Myself In.” The song has been played nearly 7 million times.

Banks and Bennett remain held at the Fulton County jail ahead of their bond hearing next month.

In other news:

Dr. NaKisha Wynn, a teacher at Woodland Elementary School, had been battling kidney disease for six years. Instead of taking time off of work, she just made chemotherapy and dialysis part of her daily life.