Officers responded to a business alarm that sounded at 11:20 p.m. Wednesday night at JJ and F Market at 520 College Avenue in Palo Alto, police said.
Arriving officers found 31-year-old Gustavo Alvarez hiding behind a tree near the store and detained him, according to police.
Police said Alvarez allegedly broke a skylight on the market's roof and used black satellite dish cable to rappel into the building.
Once inside, the store's alarm sounded, causing the suspect to flee through a rear door and over a barbed wire fence.
Police do not believe the suspect stole anything.
He was arrested on suspicion of burglary and taken to the Santa Clara County Main Jail.