Jupiter took a bullet for us last weekend.

An object, probably a comet that nobody saw coming, plowed into the giant planet's colorful cloud tops sometime Sunday, splashing up debris and leaving a black eye the size of the Pacific Ocean. This was the second time in 15 years that this had happened. The whole world was watching when Comet Shoemaker-Levy 9 fell apart and its pieces crashed into Jupiter in 1994, leaving Earth-size marks that persisted up to a year.

That's Jupiter doing its cosmic job, astronomers like to say. Better it than us. Part of what makes the Earth such a nice place to live, the story goes, is that Jupiter's overbearing gravity acts as a gravitational shield deflecting incoming space junk, mainly comets, away from the inner solar system where it could do for us what an asteroid apparently did for the dinosaurs 65 million years ago. Indeed, astronomers look for similar configurations - a giant outer planet with room for smaller planets in closer to the home stars - in other planetary systems as an indication of their hospitableness to life.

Anthony Wesley, the Australian amateur astronomer who first noticed the mark on Jupiter and sounded the alarm on Sunday, paid homage to that notion when he told The Sydney Morning Herald, "If anything like that had hit the Earth it would have been curtains for us, so we can feel very happy that Jupiter is doing its vacuum-cleaner job and hoovering up all these large pieces before they come for us."

But is this warm and fuzzy image of the King of Planets as father-protector really true?

"I really question this idea," said Brian G. Marsden of the Harvard-Smithsonian Center for Astrophysics, referring to Jupiter as our guardian planet. As the former director of the International Astronomical Union's Central Bureau for Astronomical Telegrams, he has spent his career keeping track of wayward objects, particularly comets, in the solar system.

Jupiter is just as much a menace as a savior, he said. The big planet throws a lot of comets out of the solar system, but it also throws them in.

Take, for example, Comet Lexell, named after the Swedish astronomer Anders Lexell. In 1770 it whizzed only a million miles from the Earth, missing us by a cosmic whisker, Dr. Marsden said. That comet had come streaking in from the outer solar system three years earlier and passed close to Jupiter, which diverted it into a new orbit and straight toward Earth.

The comet made two passes around the Sun and in 1779 again passed very close to Jupiter, which then threw it back out of the solar system.

"It was as if Jupiter aimed at us and missed," said Dr. Marsden, who complained that the comet would never have come anywhere near the Earth if Jupiter hadn't thrown it at us in the first place.

Hal Levison, an astronomer at the Southwest Research Institute, in Boulder, Colo., who studies the evolution of the solar system, said that whether Jupiter was menace or protector depended on where the comets came from. Lexell, like Shoemaker Levy 9 and probably the truck that just hit Jupiter, most likely came from an icy zone of debris known as the Kuiper Belt, which lies just outside the orbit of Neptune, he explained. Jupiter probably does increase our exposure to those comets, he said.

But Jupiter helps protect us, he said, from an even more dangerous band of comets coming from the so-called Oort Cloud, a vast spherical deep-freeze surrounding the solar system as far as a light-year from the Sun. Every once in a while, in response to gravitational nudges from a passing star or gas cloud, a comet is unleashed from storage and comes crashing inward.

Jupiter's benign influence here comes in two forms. The cloud was initially populated in the early days of the solar system by the gravity of Uranus and Neptune sweeping up debris and flinging it outward, but Jupiter and Saturn are so strong, Dr. Levison said, that, first of all, they threw a lot of the junk out of the solar system altogether, lessening the size of this cosmic arsenal. Second, Jupiter deflects some of the comets that get dislodged and fall back in, Dr. Levison said.

"It's a double anti-whammy," he said.

Asteroids pose the greatest danger of all to Earth, however, astronomers say, and here Jupiter's influence is hardly assuring. Mostly asteroids live peacefully in the asteroid belt between Mars and Jupiter, whose gravity, so the standard story goes, keeps them too stirred to coalesce into a planet but can cause them to collide and rebound in the direction of Earth.

That's what happened, Greg Laughlin of the University of California at Santa Cruz, said, to a chunk of iron and nickel about 50 yards across roughly 10 million to 100 million years ago. The result is a hole in the desert almost a mile wide and 500 feet deep in northern Arizona, called Barringer Crater. A gift, perhaps, from our friend and lord, Jupiter.