A man wanted in connection with an attempted murder was arrested Thursday night after an hourslong standoff that shut down a Southern California freeway during rush-hour traffic on Cinco de Mayo.

The arrest capped a long evening in the Inland Empire where a man held officers at bay while he stayed inside a disabled Mercedes-Benz after a pursuit.

Officers stood outside their car doors during the standoff with their guns drawn while thousands of motorists sat stranded in cars in Corona.

The man led police on the chase from Compton through Orange County, mostly traveling at slow speeds and at times clipping other vehicles while weaving through traffic.

The chase began in Compton at 6:20 p.m., according to the watch commander at the Los Angeles County Sheriff's Century Station

The Mercedes-Benz's tires were flattened by spike strips.

The man, who was also suspected of brandishing a weapon, continued driving — with the sleek black vehicle scraping along k-rails and at least one of its wheels seized and sent up sparks from its bare rim, until about 7:30 p.m. -- when it came to a smoking halt in the Santa Ana Canyon area near the Riverside County border.

Officers with guns drawn positioned themselves a short distance away and traffic on both sides of the freeway was halted as the standoff continued.

Around 9:30 p.m., SWAT officers from Anaheim took the suspect into custody, according to reports from the scene.

All lanes of the 91 were shut down near Green River Road. Traffic was backed up for miles.

Deputies said the man was wanted in an attempted murder, a drive-by shooting on May 2, in which the gun malfunctioned, deputies said. Four people were in the car, officials said. It was not immediately known whether the man in Thursday's pursuit was the one with the gun.

Deputies said they spotted the man Thursday in a Mercedes and he failed to pull over for a traffic stop.

City News Service contributed to this report.