Just a brief note today in praise of Apple CEO Tim Cook. His decision to defy a court order in an extremely high-profile case is probably not as big a gamble as it may first appear, but it’s still one of those major decisions that causes a leader to swallow hard first. He’s showing courage and leadership—though that doesn’t mean this will all turn out well.

The case is that of last October’s terrorist shooting in San Bernardino, California, so it triggers plenty of powerful emotions. The FBI wants to see the data in the iPhone of one of the attackers, but it can’t get past Apple’s security features. So at the FBI’s request, a court has ordered Apple aapl to create software that would enable the FBI to get into the phone. Cook says no.

In defying the order, Cook takes the position that he’s protecting his customers against evil-minded hackers and, without saying so, against governments that may or may not be motivated by noble intentions. He’s thus aligning himself with very broad constituencies. He’s also defending the Apple engineers who are proud to have created the invulnerable security features and who would be deeply demoralized if forced to write new code to defeat them. Above all, it appears, Cook is trying to avoid a precedent that would encourage governments around the world to demand that Apple break into customers’ phones. He also wants to avoid creating break-in code for the FBI that could conceivably fall into the hands of others.

Sign up for Power Sheet, Fortune’s daily morning newsletter on leaders and leadership.

Those are all solid, sensible stances for Cook to take. And as Apple’s lawyers fight back, they might win. The obvious danger is that if they don’t, the resolution could be one that Cook really hates.

So Cook’s leadership decision here is that it’s time to resolve this momentous issue one way or the other. The circumstances could make this an epic case. It pits the world’s most valuable technology company, possessing what seems to be the strongest security measures, against the U.S. government over the investigation of a particularly famous and horrific crime. Some commentators think it could go to the Supreme Court. It could also lead to new laws written for the digital age.

Cook has chosen to put himself and Apple at center stage on an issue of central importance to the technology industry, criminal justice, and society, with no assurance of where this choice will lead. He apparently just believes it’s time this issue got confronted head-on. That’s leadership behavior, and whatever the outcome, it elevates Apple’s status.