President Obama listens to remarks while hosting a community discussion on drug addiction in Charleston, W. Va., on Oct. 21. (Kevin Lamarque/Reuters)

A recurring theme of extreme criticism of President Obama over his two terms has been that he secretly harbors hostility toward things central to the American identity. He secretly hates Christianity. He secretly hates the Constitution. He secretly hates America itself.

But few theories of Obama's hatred have been as sustained and as broadly accepted as the idea that he hates police officers. In the wake of the horrific attack Thursday night on law enforcement in Dallas, social media was peppered with the idea that the attacks might somehow be linked to purported anti-cop rhetoric from the president. The most infamous example probably came from former Illinois congressman Joe Walsh, whose tweet telling Obama to "watch out" was deleted, but who provides other examples.

So where did this idea that the nation's commander in chief hates police come from?

One of the first examples that's frequently cited came in the first year of Obama's first term. In July 2009, historian Henry Louis Gates, who is black, was arrested while trying to force his way into his own home in Cambridge, Mass. (The door was jammed.) As the incident gained national attention, Obama weighed in, saying that the arresting officer had "acted stupidly" for handcuffing and booking Gates. Probably in large part thanks to the political value of defending police officers, the comments quickly metastasized, with former Michigan congressman Thaddeus McCotter introducing a resolution in the House demanding that Obama apologize for his comments. The National Republican Senate Committee used Obama's remarks to mobilize its base, asking Americans to sign a petition if they thought it was inappropriate for "our nation’s Commander in Chief to stand before a national audience and criticize the men and women in law enforcement who put their lives on the line every day." Obama defused the controversy in part by inviting Gates and the arresting officer to a "beer summit" at the White House.

The following April, conservative radio host Rush Limbaugh suggested that perhaps a "tequila summit" was also in order, because of comments Obama made about Arizona's just-passed law that cracked down on immigrants in the country illegally.

"Barack Obama, ladies and gentlemen, he's got something in for the cops, there's no question," Limbaugh said. "You go back to Cambridge. This guy's got some problem with police officers." Why? Because Obama worried that Hispanic Americans in Arizona would be harassed "if you don't have your papers, and you took your kid out to get ice cream."

Limbaugh:

So that's his argument, to create a phony hypothetical where families getting ice cream are hassled by stupid, bigoted policemen. This is gonna require a massive tequila summit before this is all over. We had a beer summit up in Cambridge. So Obama's now not satisfied with just attacking a state. He has to attack their police as well. I'll tell you what's poorly conceived here, is Obama's views on the cops. He thinks all these cops are going to act stupidly. This is an outrageous answer, this is an outrageous thing.

In 2011, the idea took another turn. Leveraging long-dormant worries about violent rap music, critics of the president decried his inviting the rapper Common to the White House as part of an event celebrating poets. Critics of Obama seized upon Common's track "A Song for Assata," dedicated to Assata Shakur, who was convicted of killing a police officer and who then fled to Cuba. It was a New Jersey police officer whom Shakur was convicted of killing, and a New Jersey State Police spokesman criticized Obama for extending an invitation to someone who defended "a fugitive who killed one of our own."

The issue lay mostly fallow over the course of the 2012 election, subsumed by concerns over other things Obama "hates," such as guns. But the idea that Obama hates law enforcement gained powerful new energy in 2013 and 2014.

In November 2013, Obama nominated Debo Adegbile to a position in the Department of Justice. Opponents of the move quickly seized upon Adegbile's having signed a friend-of-the-court petition on behalf of Mumia Abu-Jamal, who was convicted of the murder of a Philadelphia police officer in 1982. The Senate ultimately blocked that nomination, with opposition focused on the Abu-Jamal filing.

But it was the police-involved deaths of Michael Brown in Ferguson, Mo., and Eric Garner on Staten Island in 2014 that kicked the Obama-hates-cops sentiment into overdrive. Brown's death prompted Obama to release a statement offering his condolences to the family and calling for calm. The failure of grand juries to indict the officers involved in either man's death gave rise to the politically contentious Black Lives Matter movement — which itself was blamed for the murders of two police officers in a patrol car in New York that December.

Former New York City mayor Rudy Giuliani traced those officers' deaths back to the president. "We’ve had four months of propaganda, starting with the president," he said on "Fox News Sunday" that month, "that everybody should hate the police." Our Fact Checker gave that assertion four Pinocchios, meaning it lacked any truth. That verdict was supported by a look at what Obama had actually said, and found no evidence that he'd said anything of the sort. (That article also includes a comment from Joe Walsh, arguing that Obama was to blame.)

Ever since, as tension between the community and the police has persisted, so have charges that Obama is hostile to the latter. In October 2015, for example, Obama was criticized for supporting changes to police practices and for meeting with members of the Black Lives Matter movement who "appear to hate all cops," a New York Post report said at the time.

It's impossible not to note that each of these incidents centers in some way on race: Gates, rap music, Black Lives Matter. That Obama has been receptive to the concerns of protesters is clearly amplified by how Obama is himself black and that he has framed some of what police departments need to improve upon in explicitly racial terms. Some small part of the interest in siding with the police in opposition to Obama — if one chooses to look at the two in opposition — is probably motivated by race-based assumptions. More broadly, though, it's Obama's focus on problems in police work that happen to deal with race, which are blended into a sense that he opposes law enforcement broadly.

This brings us to the horror that occurred Thursday night. Walsh was by no means alone in suggesting that the fault lay with Obama — unsurprising given how long Obama has been surrounded by criticisms of his views of law enforcement. With the obvious exception of calling the actions of the police in Cambridge "stupid," though, Obama's comments about police have been positive even as he has called for improvements. That call for improvement is, to many, enough to suggest that the president broadly dislikes all American police officers.

Which seems to say far more about our politics than it does about Obama.