var _ndnq = _ndnq || []; _ndnq.push([’embed’]);

SAN JOSE — A weeklong manhunt that riveted the Bay Area concluded late Wednesday with two inmates who broke out of Santa Clara County back in custody following a week on the lam.

Capping an intense two-day crescendo featuring multiple raids on homes, a motel and a recreational vehicle where the inmates were thought to have been hiding, San Jose resident Rogelio Chavez was nabbed Wednesday in South San Jose following an 8-hour standoff. As police lobbed tear gas into the home he occupied, Chavez apparently celebrated his last hours of freedom with a drug binge.

His capture came a day after Palo Alto resident LaRon Campbell was arrested in Antioch. On Nov. 23, the inmates sawed through the steel bars of their second-floor window in the south wing of the Main Jail on West Hedding Street, then rappelled down on a makeshift rope formed from bed sheets and clothing.

“We really owe the deputies here a debt of gratitude for everything that they’ve done,” Sheriff Laurie Smith said at a news conference late Wednesday outside the window where the inmates escaped. “We have these two dangerous inmates back in custody.”

On Wednesday afternoon, sheriff’s deputies and tactical officers surrounded a South San Jose residence near Judith Street and Coy Drive, west of Oak Grove High School, as part of their hunt for Chavez. Authorities said an associate of Chavez was linked to the home.

Sheriff deputies search for escaped jail inmate Rogelio Chavez near Coy Park apartments in San Jose. pic.twitter.com/XKKSxtLPZI — Karl Mondon (@karlmondon) November 30, 2016

Sheriff’s deputies issued commands for people inside to come out and later deployed gas inside the residence. Around 8:30 p.m., deputies led Chavez out of the home in handcuffs.

Chavez spent part of the standoff holed up in the attic of the home, though he was ultimately arrested without incident in a room, authorities said. He appeared to be under the influence, said Smith, adding that he was found in possession of crack cocaine and marijuana. Chavez was taken to a hospital for medical attention before being transported to jail.

Karla Fernandez, a resident of the home and a friend of Chavez, also was arrested. She was booked for resisting arrest, obstructing an investigation, being a felon in possession of a firearm and being an accessory to Chavez’s escape, Smith said.

“The investigation is ongoing and there may be additional arrests in the future of people who had harbored Chavez,” Smith said.

Campbell’s run from the law reportedly ended with him crashing down through the ceiling of his sister’s Antioch home Tuesday night, literally in front of arriving officers.

The scene, reminiscent of a campy TV cop-show plot, ended with Campbell’s arrest, and also the arrest of his sister, 24-year-old Marcaysha Alexander, who authorities booked on suspicion of harboring a fugitive.

Ken Augustino, 52, lives next to the residence where Wednesday’s standoff took place. He was working at home when he noticed sheriff’s deputies armed with rifles descend on the neighborhood. Authorities advised him to leave his home around 3:30 p.m. because they were planning to use tear gas.

Augustino said he was surprised Chavez had managed to elude authorities for a week.

“I don’t understand how he’s ever going to escape notice,” said Augustino, referring to Chavez’s facial tattoo.

Campbell’s capture was fueled in large part by public tips received Monday after a $20,000 reward offer by Smith. Sheriff’s investigators, the U.S. Marshals Service and Antioch police tracked Campbell to his sister’s home in the 1000 block of James Donlon Boulevard.

“After several hours of constant surveillance, the marshals were able to see that Campbell was indeed at the residence,” Undersheriff Carl Neusel said at a Wednesday news conference.

Around 10 p.m. Tuesday, authorities served an arrest warrant at the home, and Campbell tried to elude them for a few more moments before he was arrested.

“Upon entering the residence, they determined that Campbell was hiding in the attic, and Campbell then crashed through the ceiling onto the floor,” Neusel said with deadpan delivery, “where the Marshals Service and Antioch police took him into custody without further incident.”

Neusel added: “There are few things more satisfying than taking desperate, violent people into custody so they can face justice.”

A source familiar with the investigation told this newspaper that Campbell has been placed in the Main Jail’s psychiatric wing after he was taken back to Santa Clara County and evaluated.

Neusel lauded the public tips the Sheriff’s Office received in the wake of the escape.

“Our investigation has benefited greatly from the steady public tips we have received,” he said. “This investigation has been an all-hands-on-deck effort.”

Investigators said surveillance video shows Chavez was at the Days Inn on Leavesley Road in Gilroy as recently as Sunday when deputies swarmed the motel but missed him.

One of three people detained at the motel, 35-year-old Emily Vaca, was arrested on allegations she helped Chavez elude capture by driving him around. Vaca was arraigned Wednesday in a Morgan Hill courtroom on a charge of being an accessory to a crime.

Chavez was booked in August on charges including burglary, extortion, false imprisonment, resisting arrest and firearms violations. Campbell had been in custody since February 2015 on charges that include robbery, false imprisonment, criminal threats and firearms violations.

What Campbell and Chavez used to cut through the bars, and how they got it, remains under investigation. Neusel said Sheriff’s officials’ examination of the escape so far has not revealed any obvious policy violations but that they are reviewing practices with the aim of making “the corrections as necessary in order to address and make sure this doesn’t happen again.”

There had not been a breakout escape from the Main Jail in about 15 years, according to the Sheriff’s Office. The last time the agency pursued an escaped jail inmate was in March 2015, when Johnell Lee Carter, a child-molestation suspect from Campbell in the medium-security Elmwood jail complex, overpowered a deputy while being escorted to a medical appointment. He was at large for about a month before he was found with relatives in Mississippi.

The county jails have been under heavy scrutiny since the August 2015 beating death of mentally ill inmate Michael Tyree in the Main Jail, allegedly at the hands of three correctional deputies who are currently being tried for murder. Both the Sheriff’s Office and a civilian reform commission have pushed for significant reforms in how the jails are operated.

Neusel alluded to those reforms Wednesday and reiterated a point made by other officials that the Main Jail South wing where the escape occurred is woefully out of date, constructed in the 1950s, and slated to be rebuilt. In the meantime, officials have pledged to add surveillance cameras and step up in-cell checks and monitoring of the bars and windows securing the jail wing.

Anyone with information about the case can contact the Santa Clara County Sheriff’s Office at 408-808-4500 or its anonymous tip line at 408-808-4431.

var _ndnq = _ndnq || []; _ndnq.push([’embed’]);

Staff writer Mark Gomez contributed to this report.

NOTE: This story has been corrected to reflect that the last inmate escape before this past week was about 15 years ago, not 25.