YOSEMITE NATIONAL PARK – It wasn't that long ago that a trip to see Yosemite's granite cliffs and waterfalls was a descent into bear mayhem.

In 1997, black bears broke into more than 600 cars in the park, searching for human food as they tore open the doors of cars, smashing minivan windows with their paws. They wandered into tents, overturned garbage cans and sometimes injured tourists.

"You'd drive your car to the park and then it got destroyed because you left a candy bar in the door," said Mike Tollefson, a former park superintendent.

But today, in one of Yosemite's most remarkable wildlife success stories, the bears are behaving better. Reports of bears damaging property or injuring people have fallen 92 percent — from 1,584 in 1998 to 120 last year.

Biologists say the turnaround came from an unlikely strategy — training the bears and training people.

"More and more people are doing what they are supposed to do. But it only takes one slip-up to cost a bear's life," said Ryan Leahy, a Yosemite wildlife biologist and bear expert.

Yosemite has between 300 and 500 black bears. There has never been a recorded incident of a black bear killing a person in the park.

The relationship between people and bears has changed dramatically. From 1923 to 1971, rangers regularly left food out for bears so tourists could take pictures. Until 1972, there were open garbage dumps that provided bears massive amounts of easy food — and made them seem like circus attractions.

Black bears became a growing problem in Yosemite during the 1980s and 1990s, when the number of park visitors increased to 4 million a year.

Park officials launched a new campaign that they say helped solve the problem. They expanded the number of rangers, biologists and volunteers working on bear issues from two to about 20. They required campers to store food in bear-proof lockers.

Campers are now required to sign forms saying they understand it is illegal to feed bears or store food in vehicles. The park in 2007 required everyone going on overnight backpacking trips to rent a bear canister, an impenetrable cylinder in which to store food.

Finally, park officials began fitting problem bears with radio collars. When a bear comes near a campsite, wildlife biologists will chase it, yelling and shooting a small beanbag from a paintball gun. The idea is to teach bears that coming near humans has unpleasant consequences.

"We are trying to teach them that people should be feared," Leahy said.