LONG VALLEY, N.J. (CBSNewYork) — A toddler’s close encounter with a bear ended with her dogs coming to the rescue.

The 3 ½-year-old narrowly escaped the black bear that crept into her New Jersey backyard, CBS2’s Jessica Schneider reported Thursday.

Harper Wagner and her dog, “Chief,” have literally grown up together.

Chief is the lab mix Emily Wagner rescued two years ago, but on Wednesday morning Chief was the one who rescued her daughter.

When asked what she saw, Harper said, “A bear! Chief protected me.”

The 400-pound black bear has sauntered into the backyard of their Long Valley home on many occasions, but usually just at night.

It made a much earlier appearance on Wednesday.

“She yelled ‘Mommy!’ and I looked up and there was a big bear between us,” Emily Wagner said.

Harper Wagner was playing and her mom was sitting just a few feet away on the porch when she heard the screams for help.

That’s when Chief came to the rescue.

“He grabbed his back leg like he was trying to pull him away from Harper,” Emily Wagner said.

Mother then grabbed daughter and ran inside to call police. The rest of the family’s dogs took care of the big black bear.

“The other three chased him and he went into the woods over there and climbed a tree and he wandered off,” Emily Wagner said.

Officials won’t kill a bear unless it poses a severe threat to people, something Emily Wagner has been told this bear doesn’t do.

“I’m not mad at the bear. I was mad at the bear yesterday,” she said.

Emily said she’ll just keep an extra close eye on her daughter — and her dogs — from now on.

New Jersey’s Department of Environmental Protection said the mere presence of bears is not considered a problem, and officials warn homeowners to avoid attracting bears with food or garbage, Schneider reported.