Americans are largely OK with the government tracking their communications to investigate terrorism — as long as someone from their preferred political party is running the White House.

According to a new poll from the Pew Research Center, partisan Republicans and Democrats' views on surveillance from the National Security Agency have shifted a stunning amount from the Bush to Obama administrations.

The poll found that overall, 56 percent of voters found it "acceptable" that the NSA has been "getting secret court orders to track calls of millions of Americans to investigate terrorism." That includes 64 percent of Democrats and 52 percent of Republicans.

That's a stark shift from a similar question in 2006, which asked whether voters found it acceptable that the NSA had been "investigating people suspected of terrorist involvement by secretly listening in on phone calls and reading emails without court approval." That time, only 37 percent of Democrats found it acceptable, while an astounding 75 percent of Republicans called it acceptable.

The Bush administration's wiretapping controversy included the fact that the administration argued the NSA was authorized to monitor communications without a warrant.

Today, the NSA needs a court-issued warrant, based on probable cause, before monitoring communications.

Here's a nice chart that spells out the difference:

The bottom line, however, is that a majority of people in all political parties favor the NSA's actions. When asked, generally, whether privacy or security was more important, 62 percent said it was more important to investigate potential terror threats. Only 34 percent said it was more important to not intrude on privacy.

This post has been updated to provide more details on the difference between the NSA's surveillance operations in 2006 and 2013 controversies.