At times, Kentucky Sen. Rand Paul can have all the tact and graciousness of an arrogant college student. He’ll talk as if no one else could have his insight or perception, leading to embarrassments like last year’s speech at Howard University, where he lectured black politics students on the civil rights record of the Republican Party.

He almost put a foot in it again last week, during an address to the College Republicans at the University of California, Berkeley. “I find it ironic that the first African-American president has without compunction allowed this vast exercise of raw power by the NSA,” he said, taking a swing at Obama, “Certainly J. Edgar Hoover’s illegal spying on Martin Luther King and others in the civil rights movement should give us all pause.”

It was a glib line, and the objections were what you’d expect. “Is a black president more responsible for stopping inappropriate NSA spying than a white one?,” wrote Zerlina Maxwell for the Grio, “This issue is complicated enough that it doesn’t need Senator Paul’s cheap shot on the president invoking race, when it’s not relevant.” Likewise, at Salon, Elias Isquith condemned Paul for “whitesplaining Martin Luther King, Jr. to the first African American president,” especially given Paul’s “infamous” attack on the 1964 Civil Rights Act.

Maxwell and Isquith have a point, but so does Paul.

Barack Obama is the direct product of the civil rights movement, and without its hard work and sacrifice, his rise to the White House couldn’t have happened. Obama is quick to admit this. In 2007, shortly after announcing his campaign for the Democratic presidential nomination, he gave a speech to mark the anniversary of the march in Selma, Ala., where protesters—led by a young John Lewis—withstood the blows of segregationists.

“It’s because they marched that I got the kind of education I got, that I got a law degree, and a seat in the Illinois Senate and ultimately in the United States Senate,” he told the audience. “I’m here because somebody marched for our freedom. I’m here because y’all sacrificed for me. I stand on the shoulders of giants.”

He sounded a similar note last year, while commemorating the 50th anniversary of the March on Washington for Jobs and Freedom. “Because they marched,” he said, “city councils changed and state legislatures changed, and Congress changed, and, yes, eventually, the White House changed.”

We can argue all day over the goals of the civil rights movement and the extent to which its leaders fought for economic as well as social equality. There’s no question, however, of Barack Obama’s view as it relates to his life: He sees himself as the embodiment of their legacy, someone who represents the extent to which they won the battle.

In which case, Paul is right. It is ironic that the first African-American president has overseen a mass expansion of the government’s surveillance powers—powers that, in an earlier form, were used to spy on almost every figure in the civil rights movement. Under the watchful eye of FBI director J. Edgar Hoover—who directed his agents to “expose, disrupt, misdirect, discredit, or otherwise neutralize” the activities of protest groups—COINTELPRO (short for “counter-intelligence program”) invaded the lives of Martin Luther King, Jr. and other civil rights leaders.

King, in particular, was the target of an aggressive investigation. At one point, FBI agents mailed him a recording compiled from his affairs with various women. Attached was a note: “King, there is only one thing left for you to do. There is but one way out for you. You better take it before your filthy, fraudulent self is bared to the nation.”

No, Obama isn’t Hoover, and—as far as we know—he hasn’t directed the NSA to harass community leaders and derail their efforts (though his Justice Department has yet to challenge the NYPD’s spying on Muslim New Yorkers). But he holds surveillance powers that go beyond anything proposed or imagined by Hoover and his allies. Powers that, had they existed in the 1960s, would have been used to attack and discredit the men and women who made Obama’s life possible.

And COINTELPRO wasn’t the only government effort aimed at disrupting the movement. In Mississippi, officials shaped the State Sovereignty Commission into a massive spy organization, dedicated to the defense of Jim Crow. It infiltrated organizations like the NAACP and the Congress of Racial Equality, and claimed broad authority to arrest, detain, and keep secret files.

Looking at this, it’s hard not to see similarities to the Obama administration and its continued support for mass surveillance, permanent data collection, and indefinite detention.

You don’t have to support Rand Paul or his policy agenda to see that he was right to call out the president on the tension between his position and his actions. The fight for black equality was also, explicitly, a demand for America to live up to the ideals of its Declaration and the laws of its Constitution. If Obama is going to claim the legacy of the civil rights movement—if he’s going to present himself as its inheritor—then he must also grapple with his role in expanding the same surveillance state that terrorized his forbears, and may—in the future—do the same to their descendants.

To do otherwise—to ignore the deep irony of the situation—is to do himself and his legacy a disservice.