Talk about strange bedfellows: Consider the reaction to Monday's federal district court ruling that the National Security Agency's metadata program is unconstitutional.
The ruling from Judge Richard Leon —appointed by President George W. Bush —was applauded by the American Civil Liberties Union and Edward Snowden, who is accused of espionage for leaking NSA secrets.
But the lawsuit was filed by far-right gadfly Larry Klayman, who believes President Obama was born in Kenya. Judge Leon's ruling, in turn, will certainly be appealed by Mr. Obama—who was himself a ferocious critic of similar surveillance programs conducted under his predecessor.
Under the law, and subject to judicial oversight, the NSA collects the date, duration and phone number of each call made into and out of the United States. The agency can query this database only about calls made from or to numbers connected with suspected foreign terrorists. This happened 300 times last year.
The government's use of this phone data divides both political parties. Judge Leon's ruling was praised by Sens. Rand Paul (R., Ky.) and Ron Wyden (D., Ore.) and criticized by Sen. Dianne Feinstein (D. Calif.) and Rep. Mike Rogers (R., Mich.), who head the Senate and House Intelligence Committees. Though there hasn't been much public polling on the issue, it appears to divide Americans in ways that challenge both Democrats and Republicans.
By defending the NSA program and appealing Judge Leon's decision, Mr. Obama runs the risk of further alienating many young voters, who are an essential part of the Democratic Party base. Younger Americans are increasingly concerned that antiterror policies go too far in restricting civil liberties. While only 40% of millennials (ages 18-29) felt this way in an Oct. 2010 Pew poll, 60% of millennials felt so last July, a 20-point increase.
In a July 26 Washington Post/ABC News poll, 54% of millennials felt the government should investigate possible terrorist threats, even if that intrudes on personal privacy. But 45% said Washington should not intrude on personal privacy even if that limits its ability to investigate possible threats.
Then there are the Republicans, who are increasingly less likely to back policies they supported when Mr. Bush was in office. Between the October 2010 and July 2013 Pew polls, the percentage of Republicans who felt antiterror policies go too far in restricting civil liberties rose to 43% from 25% while the share of Republicans more concerned about protecting America dropped to 38% from 58%.
Perhaps surprisingly, Democrats were more likely in the July Pew survey to support the government's collection of phone and Internet data for antiterrorism purposes (57%) than were Republicans (44%) or Independents (47%).
This shift in attitude among Republicans partly reflects the increasing appeal of libertarianism within the GOP and, more important, the almost universal lack of trust in Mr. Obama among Republicans. Only 12% of Republicans in a Nov. 11 Quinnipiac poll said Mr. Obama was trustworthy while 86% said he was not.
The NSA's ability to track terrorist activity will require more than a successful appeal of Judge Leon's decision to survive. The public needs to be reminded how vital—and constitutional—these efforts are to protecting America from terrorist attacks. That hasn't happened much recently.
Even if Mr. Obama belatedly engages on this issue, his credibility has been diminished because of his repeated false statements on health care. The nation's chief executive, in short, will need bipartisan help in explaining and defending these vital programs, principally from former CIA directors like Leon Panetta and Gen. Michael Hayden (who was also an NSA director), and former Attorneys General like Judge Michael Mukasey.
Ms. Feinstein and Mr. Rogers as Intelligence Committee chairmen also have important roles to play, as do Sen. Patrick Leahy (D., Vt.) and Rep. Bob Goodlatte (R., Va.), the chairmen of the Senate and House Judiciary Committees.
The horrifying memories of 9/11 are fading for many Americans. The same can't be said for Islamic militants, whose burning hatred for us is undiminished. It now requires leadership to refocus the American people on the lethal terrorist threats we face and the importance of the NSA's tools in combating them.
A version of this article appeared December 19, 2013, in the U.S. edition of The Wall Street Journal, with the headline How Obama Can Save the NSA and online at WSJ.com.