By Andria Borba

SAN FRANCISCO (KPIX) — If all good dogs go to heaven, one San Francisco pooch tried to get there multiple times, only to be rescued in spectacular fashion.

It was an adventure that began on southbound Highway 101 at the Cesar Chavez exit in San Francisco. That’s where a dog which was later dubbed “Baby Jessica” by S.F. Animal Care and Control was first spotted Wednesday morning.

READ MORE: Two Die In East Oakland Sunday Night Shooting

Then there was a sighting at 25th Street and Vermont near where the animal became stuck between two buildings on San Bruno Avenue, six feet below a deck, with very little wiggle room.

“(The space between buildings) was only about, I’d say, a foot and a half to two feet wide and then when you’re going down there’s pipes and wires and loose boards and nails sticking out,” said Capt. Amy Corso.

The effort to rescue “Baby Jessica” took six hours.

First, a board provided by a building superintendent was lowered so the dog could walk out on her own.

READ MORE: Steph Curry, Draymond Green Ready For Play-In Game; Warriors To Take On Lakers Wednesday Night

That didn’t work.

“Unfortunately the board was long and bowed in the middle with the weight,” Capt. Corso said.

Then a veterinarian and other officers squeezed between buildings, sedated “Baby Jessica” and hoisted the 12 year old dog out.

“I don’t know how they fit down there and I don’t know how we got them back out,” Corso said.

MORE NEWS: Demonstrators Call on San Francisco to Keep Great Highway Closed to Cars

“Baby Jessica” was reunited with her owner this afternoon and is in good shape, despite several brushes with danger Wednesday.