We live in an age of rampant terrorism, a grotesque phenomenon that manifests itself these days particularly in the Middle East. In countries such as Iraq, Syria, Lebanon and Israel, terrorism has become pervasive, wiping out lives, destroying property and creating a climate of uncertainty and angst.

With the rise of Al Qaeda and Islamic State, the geography of terrorism has spread beyond the borders of the Middle East. From New York City in 2001 to Paris in 2015, the long and deadly arm of terrorism has inflicted pain and suffering beyond belief.

Last December, in San Bernardino, California, an American citizen of Pakistani Muslim descent, Sayed Rizwan Farook, and his wife, Tashfeen Malik, murdered 14 people in a senseless killing spree that shocked and appalled Americans from sea to sea.

By all accounts, the demented couple was inspired by Islamic State, a Sunni jihadist organization which has wreaked death and destruction throughout the world since its rise a few years ago.

As the Farooks raced away from the scene of the crime, they were fatally shot in their getaway van by police, leaving a trail of unanswered questions regarding their motives and preparations.

Farook, however, left behind a cell phone, an iPhone 5c manufactured by Apple, one of the most successful companies in the United States. Much to its frustration, the Federal Bureau of Investigation has been unable to unlock his phone. Its encryption technology is so sophisticated that it defies entry.

Herein lies a problem of major proportions.

The FBI cannot solve this crime in its entirety unless it has access to the voice recordings in Farook’s phone. Clearly, the FBI needs Apple’s full cooperation to unlock the phone, but Apple is not in a cooperative mood. It has no intention of complying with a U.S. federal court order to unlock the phone.

The standoff raises questions about two vital issues — privacy and national security — and may yet be settled by the U.S. Supreme Court. In the meantime, a debate of historic proportions has begun, and it will be watched closely.

Sheri Pym, a federal judge in the California district where last December’s crime unfolded, has essentially ordered Apple to build the software that would enable the FBI to unlock the secrets of Farook’s phone. The FBI claims its data will be permanently lost unless Apple steps in.

Eileen Decker, the United States attorney in Pym’s district, has provided the legal rationale for her draconian order. “We have made a solemn commitment to the victims and their families that we will leave no stone unturned as we gather as much information and evidence as possible,” she said in a statement. “These victims and families deserve nothing less.”

Timothy Cook, the chief executive of Apple, begs to differ, claiming that the “unprecedented” order would compromise its encryption standards and thereby obliterate the privacy its customers enjoy and value. As he said: “The government could extend this breach of privacy and demand that Apple build surveillance software to intercept your messages, access your health records or financial data, track your location or even access your phone’s microphone or camera without your knowledge.”

These arguments cannot be dismissed, but in an era when terrorists are running amok and threatening the lives of citizens and the national security of states, democratic governments have a right, as well as a duty, to protect their respective homelands.

The newest encryption technologies, as exemplified by Apple’s iPhone, should not hamper the ability of law enforcement agencies to track down terrorists and solve crimes.

Terrorists want to create chaos, disorder, mayhem and fear, the very elements that would imperil the concept of privacy we all cherish and perhaps even undermine the foundations of democratic societies.

We cannot afford to take that risk. We would do so at our peril.

Citizens’ privacy is important, of course, but national security ultimately trumps the privacy of individuals. National security should not be abused, but it’s the glue that binds together our democratic values and institutions, the bedrock of Western democracy.

The federal government and Apple should attempt to reach an agreement that would strike a sensible balance between privacy and security, but if that proves impossible, national security should be the factor that determines the final outcome of this case.