HAYWARD — A second suspect was arrested early Friday in what sheriff’s officials now say was an attempted robbery and stabbing Thursday afternoon at a Jack-In-the Box restaurant in unincorporated Hayward.

The victim, an Oakland man, is in critical condition at a hospital with numerous internal injuries including a punctured lung, authorities said.

The suspect arrested Friday was identified as Alfredo Rubio, 56. His suspected accomplice, Adrian Lopez, 26, was arrested soon after the Thursday afternoon attack. The two Hayward men are being held without bail on suspicion of attempted murder, attempted robbery and assault with a deadly weapon, officials said.

Alameda County sheriff’s Sgt. Ray Kelly said the stabbing happened about 2:15 p.m. Thursday in the drive-through lane at the restaurant, located in the 18500 block of Mission Boulevard.

Kelly said the two suspects were lying in wait to rob someone in the line and targeted the Oakland man who was driving his car with his girlfriend as a passenger.

The suspects approached the driver’s side window and at least one of them simulated a gun and tried to rob the Oakland man, Kelly said. But the intended victim fought back and Kelly said both suspects stabbed him multiple times before running away.

Lopez was arrested within minutes in the 800 block of Paradise Boulevard.

Deputies used canines and a drone to search nearby streets and the shoreline of San Lorenzo Creek for the second suspect who turned out to be Rubio. He was able to elude capture Thursday as he had left the area on a bicycle he had hidden and had also changed his clothes, authorities said.

His fugitive status ended about 2 a.m. Friday when an alert deputy recognized him and arrested him in Hayward, Kelly said.

Harry Harris is a Pulitzer Prize winning breaking news reporter for the Bay Area News Group. He began his Oakland Tribune career in September 1965 as a 17-year-old copyboy. He became a reporter in 1972 and is considered one of the best crime and breaking news reporters in the country. He has covered tens of thousands of murders and other crimes in the East Bay. He has also mentored dozens of young reporters, some of whom continue to work in journalism today.