Being a parent in San Francisco can be frustrating. So can dealing with homeless people. And with petty theft.

Kara McPhail, a North Beach mom, had the unfortunate experience of dealing with all three at once – but, hey, at least this story has a relatively happy ending.

McPhail, 40, has a $500 Bob stroller for her 2-year-old boy and keeps it locked to a rail on her front stoop. She returned home on a recent morning to find the stroller gone and its contents, including snacks and a baby blanket, tossed on the ground.

That afternoon, she was in Washington Square with her boy when she spotted a homeless man using her stroller like a shopping cart – filled with garbage bags and other junk.

“I freaked out, and I immediately started following him,” she said.

She called 911, and the operator said they were too busy to deal with the problem but that they’d call back later. McPhail kept following the guy, carrying her child. When she passed Columbus Cafe, two bartenders hanging out in front asked if she was OK – and she explained what was going on.

“Literally, before I could even finish my sentence, they grabbed him right there in the street, grabbed all his stuff out of the stroller and threw it in the street,” she recounted. “They said, ‘You scumbag! You stole a mom’s stroller?’ ”

McPhail said she grabbed the stroller and ran.

Hours later, an operator from 911 called back and asked McPhail if she’d still like to speak to the police.

“I said, ‘No,’ ” McPhail recalled. “I actually found some great bartenders, and we took care of it ourselves.”

Her tot’s back in his (well-cleaned) stroller, but the family might not be here for long. McPhail said Burlingame is looking better and better.