LONDON — For years, 30,000 red and white balloons flooded into the blue sky above Gibraltar each September, symbols of the joy and pride of the small community jutting into the sea as it celebrated its National Day.

But what goes up must come down — sometimes as a hazard to wildlife — and Gibraltar, the tiny British territory at the southern tip of Spain, has become the latest community to take action by banning the release of helium-filled balloons.

Antipollution campaigners have long warned coastal communities that these festive accessories pose a deadly threat to marine wildlife once they end their flight in the oceans. In recent years, the authorities on Gibraltar, which stands at the only gateway from the Atlantic to the Mediterranean, became aware of the damage the balloons were doing.

Announcing the ban in a statement on Thursday, Gibraltar’s government said it wanted to “reiterate its commitment to clean seas, free of plastics and other nonbiodegradable materials which cause so much harm to wildlife.”