(CNN) As two teens watched TV at home late one night, little did they know that the person in the other room opening the refrigerator for a midnight snack wasn't a person at all.

It was a bear.

"I heard footsteps, and then I heard Tupperware being opened really loudly and aggressively," 15-year-old Hayes Sherman said. "The fridge started to beep because it was open too long.

"I was really scared. I wasn't exactly sure of what to do. I was watching TV with my friend, and I turned the TV off. We both went to the sliding door to hold it in place so that the bear couldn't get in."

A Nest camera in the living room captured the Goldilocks moment. The black bear stood on its hind legs, sniffing around and pawing through the fridge of the family's cabin in Truckee, California, about 12:30 a.m. Saturday.

The bear broke the Tupperware to eat some taco meat, Hayes said. Two pints Ben and Jerry's ice cream -- Half Baked and The Tonight Dough flavors -- and some crackers were also on the menu.

Hayes said he had heard a lot of stories about bears getting into the gated, private community near Lake Tahoe. The family had an issue with bears the year before, when they discovered that one had ripped more than a dozen window screens off the house.

The bear scoured the kitchen for food.

On Saturday morning, Hayes' mother and her cousin were sleeping upstairs, unaware of what was unfolding.

The bear bumped into the door as Hayes and his friend, 15-year-old Bobby Harden, held it shut. The door shook as the bear tried to open it multiple times.

The teens realized that they didn't have their phones with them. While he and Bobby held onto shaking door, Hayes used his Apple watch to call his mother.

"I whispered to her, 'Mom, there is a bear in the house. Don't come downstairs,' " Hayes said.

Hayes hung up and called 911, while his mother called the community gate house and asked for a security guard.

"It was very difficult, because I was whispering to 911 on my watch in a very dark room while trying to hold the door closed so the bear couldn't get in," Hayes said.

It took 13 minutes for the police to arrive, but it felt like an hour to Hayes "because it was so scary."

His mom, Susan Mohun, said she fought every urge to race down the stairs.

"That is the worst-case scenario as a parent to have a bear between you and your children. I am glad that I didn't run downstairs, because that probably would have just agitated the bear," Mohun said.

At first, Mohun said, she didn't believe her son.

"I saw my car doors were opened, and I heard the refrigerator alarm beeping really loudly and realized those were two bad signs," she said.

A flashlight at the front door signaled that help had arrived. Placer County Sheriff's Deputy Allyson Prero opened the door, got out of the way and let the bear leave the house, according to the sheriff's office

The bear walked out the front door and lingered in the driveway, the sheriff's office said. Prero fired a warning shot from her shotgun to shoo the bear away.

"We came out, and we went to hug her, and we took a photo with her because we were just so grateful that she came to save us," Hayes said.

The teens had left the garage door open, something they said they won't ever do again in bear country.

"We learned a very valuable lesson in bear country to always lock your windows, your doors, your garage doors and car doors," Hayes said.

The sheriff's office said bears are common in the area, and there are things residents can do to stay safe.

"Deputies have responded to many bear related calls in the Tahoe area the last couple of weeks and want to remind our home owners and visitors to lock their car doors and all residence doors," it wrote on Facebook. "Additionally, don't leave any food in cars. Bears have a very keen sense of smell and will find it, even behind locked car doors!"

For Mohun, it's an experience she won't ever forget.

"It was one of the scarier parenting moments I've ever had, but thank God it all worked out," she said.