A bylaw banning the Vancouver Aquarium from keeping whales, dolphins and other cetaceans at its Stanley Park facility has been struck down in B.C. Supreme Court.

The Vancouver Park Board implemented the ban last year amid mounting pressure from animal rights groups, but Justice Andrew Mayer found the decision violated the aquarium's 30-year licence agreement.

Under that agreement, which will expire in 2029, the board promised not to interfere with the aquarium’s day-to-day operations.

"As a result the bylaw amendment is not enforceable," Mayer wrote in his decision.

The case did not address the ethical implications of cetacean captivity, which opponents consider unacceptably cruel and the aquarium has justified as a means of furthering its conservation research.

"The question of whether whales should be kept in captivity for any purpose is a contentious and emotional one," Mayer said. "It is not for this court, at this time, to evaluate the ethics of doing so. It is the job of this court to first consider whether the Vancouver Park Board had the authority to pass the [ban]."

As the cetacean ban applies to all parks within the city's jurisdiction, it was not quashed completely – the court only declared the bylaw void “to the extent that it applies to the operations of the Vancouver Aquarium.”

Mayer also awarded the aquarium costs in the case.

The decision follows just a few weeks after aquarium officials announced they were voluntarily giving up the years-long fight over cetacean captivity. President John Nightingale said the public outcry was distracting from the aquarium's conservation work.

"The ongoing controversy and the discussion in the community had gotten to the point where it's debilitating our ability to get on with our principle mission, which is engaging more people," Nightingale told CTV News in January.

"What's going on in the world's oceans is changing so rapidly, it needs every ounce of effort that all of us can give it. We could use the energy that those people spend bashing the aquarium to help with issues in nature."

Nightingale said the facility continued moving forward with its court challenge against the park board on principle.

On Friday, the aquarium said it's pleased with the court's decision but has to review the judgment before commenting on how it might impact the organization moving forward.

Animal Justice responded to the ruling by pointing to the number of cetaceans that have died at the aquarium in recent years, including two belugas, a harbour porpoise and a false killer whale, and arguing it's time to end the practice nationwide.

A senate bill that would ban captivity and captive breeding is already moving through parliament, the group noted. The only other facility that currently holds cetaceans in Canada is the Marineland amusement park in Niagara Falls.

"It is clear that whale and dolphin captivity is an archaic, dying practice that will soon be outlawed," Animal Justice said in a news release.