The timing for Barack Obama couldn’t be worse. Just as he meets for the first time to forge a new diplomatic relationship with his Chinese counterpart, President Xi Jinping, a series of exposes on the secret surveillance programs of the US National Security Agency has presented a major distraction and eroded America’s moral high ground.

The meeting at a gigantic estate in California called Sunnylands is a chance for the two world leaders to establish personal rapport and find common ground, but it’s also inevitably a joust for diplomatic leverage. After months of leaked reports about Beijing’s cyber espionage campaign against US corporations and military targets in the lead-up to the Sunnylands meeting, Obama was expected to put cyber-security near the top of the agenda—and he probably will still do so.

But now Xi has an easy rejoinder to any criticisms from Obama: how can the US complain when has been caught running a large-scale data harvesting program? The NSA’s inclusion of Americans among its targets has raised the most controversy, but don’t forget that the program is purportedly aimed at foreigners—surely many Chinese among them.

What’s more, the central US criticism has been that by targeting corporations and intellectual property, China’s online intrusions don’t follow the well-established rules of nation vs. nation espionage. But the NSA’s snooping suggests that Washington is all too comfortable tweaking rules to its own benefit.

Republican Senator Rand Paul, never a fan of the president, said there were “great ironies” associated with any attempt Obama might make to argue civil liberties with Xi. He told Yahoo News that the NSA surveillance bombshells “take away from his moral authority to lead the nation.”

A spokesman for the White House said that Obama “welcomes a discussion of the tradeoffs between security and civil liberties.” That discussion will have to take place not just between Obama and Xi, but between the US president and his citizens, who prior to this week’s revelations may have thought they were living in a country where such widescale surveillance was the stuff of dystopian sci-fi movies.

As the Twitter user Kevin Ruffe wrote on Thursday evening, “China built a Great Firewall & people knew they weren’t free. America built a hall of 2-way mirrors & people felt they were free.”