President Trump delivered a bleak, foreboding and intensely xenophobic speech to law enforcement personnel on Friday. It was filled with allusions to “radical Islamic terrorism,” crime in Chicago, tides of dangerous immigrants, and people “burned to death” and “stuffed in barrels.” He encouraged officers to brutalize criminal suspects. He painted the dimmest possible picture of America, one in which racial and ethnic minorities and immigrants presented the biggest threat and violence was an appropriate response.

It was an unhinged speech, but many of the police officers sitting in the audience adored it. They applauded. They laughed. They seemed to soak up every word.

The news media has treated Trump’s speech largely as an extension of his own xenophobia and zest for extrajudicial violence, and has focused on the way police forces and organizations officially denounced Trump’s calls for police brutality. But the bigger story is how receptive the people in the room were to his message.

That receptivity should come as no surprise. For decades, many rank-and-file officers, and their unions, have flirted with Trump-style figures and embraced Trump-esque ideologies, especially in moments when intense social activism challenges their authority. Their willingness to do so has exacerbated many Americans’ perceptions of the police as fundamentally disinterested in — if not opposed to — a more just and equitable society.

The critical analog here is the 1960s. Throughout that decade, and especially during the civil rights revolution and antiwar protests, activists challenged the core of the status quo. In the name of social justice, they disrupted the everyday rhythms of society via protest.

The police were tasked with stopping those protests and maintaining social order. As a result, they were demonized for their role in protecting an inherently unjust status quo. And they didn’t help themselves. The Chicago police so brutalized demonstrators, journalists and even some political staff members at the 1968 Democratic convention that many labeled their conduct a police riot. Throughout the 1960s, that same department spied on, criticized and ultimately sought to end the local civil rights movement, culminating in the police assassinations of Fred Hampton and Mark Clark, two young leaders of the Chicago Black Panthers.

Police felt justified in taking such actions because they saw themselves as the guardians of an order that activists challenged. But their actions provoked intense backlash. As a consequence, interviews with police officers from the time revealed a resentful and beleaguered bunch, with dim opinions of black and antiwar activists.

Enter George Wallace. As Alabama’s governor, Wallace had made a name for himself as a racist and demagogue. He proudly defended segregation, denounced the civil rights movement as “communistic,” and constantly lamented the breakdown of “law and order.” In 1968, he launched a second presidential bid to take his message national.

Like Trump, Wallace was bombastic, pugnacious and uncouth. The white working class was his target audience, and he too stoked the politics of anger, fear and racism to win votes.

And like Trump, police appeared to love him. In common memory, Richard M. Nixon won over the “Silent Majority” of white voters in the 1968 election by calling for the restoration of law and order. But Wallace out-Nixoned Nixon when it came to the actual agents of that law and order.

In the run-up to Wallace’s campaign, he delivered an address to the national convention of the Fraternal Order of Police (FOP). It was starkly reminiscent of Trump’s address Friday.

In an arena dotted with banners and signs supporting his candidacy, Wallace railed against the breakdown of law and order, singling out the riots that had recently exploded across the country. A conspiracy theorist, he blamed those upheavals on outside agitators and foreign menaces, specifically a fanatical group of radicals who met in Cuba to plot a communist revolution in the United States. Just as Trump has been obsessed with undercutting President Barack Obama’s legacy, Wallace ripped President Lyndon B. Johnson for neglecting to do anything to “nip these plans in the bud,” and demanded to know “why weren’t the revolutionaries arrested — prosecuted — and punished?”

The similarities between Trump and Wallace don’t stop there.

While Trump thunders about soft laws “made to protect the criminal,” Wallace accused the federal judiciary of gutting police officers’ ability to contain crime. In the same way Trump recounted the unconfirmed story of a Chicago police officer (a “rough cookie and really respected guy”) telling him that if he were in charge the city’s violence would be gone within days, Wallace declared that if “the police of this country could run it for about two years, then it would be safe to walk in the parks.”

Wallace received a rapturous standing ovation. The national FOP’s president, John Harrington, personally endorsed Wallace. (The organization did not make official endorsements until 1988.) And a couple of months before the election, Harrington confidently stated that most police officers would vote for Wallace, not Nixon.

The 2016 election occurred at another moment of intense social activism and intense criticism of the police. The Black Lives Matter movement launched in 2012 after Trayvon Martin’s killing, and exploded after Michael Brown’s in 2014. Obama tried to walk the line between hearing those who criticized the police and those who sided with law enforcement.

He satisfied neither.

Police organizations condemned Obama’s refusal to unequivocally reject Black Lives Matter, and when local officials such as New York Mayor Bill de Blasio (D) voiced support for the movement, city officers literally turned their backs on their boss. While millions of Americans revealed that the police made them feel unsafe, feelings of being unappreciated, besieged and beleaguered once again bloomed among police.

Enter Trump. The president is nothing if not deft at tapping into people’s resentments. Trump’s world is one of sides — winners or losers, for us or against us, the status quo or chaos. And the basic point of his speech Friday, which echoed those made on the campaign trail, was that criticism of the police was illegitimate. They should not be shackled or questioned by politicians, judges or the public. Their authority should be as expansive as possible.

Officers’ embrace of such arguments is itself a product of this historical moment, and a longer one that extends back to the 1960s. For when Trump, like Wallace, says that the police are our last, best hope, that they’re on “our side” and their critics are not, it’s an argument that dovetails with the core vision that police organizations and advocacy groups have been advancing for a half-century.

Decades ago, Los Angeles Police Chief William Parker articulated the idea of the “thin blue line” to denote the police’s role in separating civilization from anarchy. Ever since, it has been a useful rhetorical tool in arguing for the expansion of police authority and rebuffing criticism of the police. The world is a dangerous place, the argument goes, and the police are the lone protectors standing between here and the abyss. To disagree is to weaken the nation.

Coupled with the general sense that their work is undervalued, this dark vision has become part of the ideological DNA of many modern police institutions. This is a detriment in and of itself, but it has also created a receptive audience for the ideologies espoused by opportunists such as Wallace and Trump.

Their rhetorical excesses and incessant fearmongering undoubtedly attract some law enforcement officers. The most generous reading of their attraction to such figures is that the majority are simply willing to look past those things because of the loud promises to support them. Regardless of their reasons, by cheering Trump, police set themselves up in the public eye as adherents to his worst ideological and xenophobic excesses. This further undermines their standing among the majority of Americans who oppose Trump.

And this is why examining the reception to Trump’s words and deeds is so important. While Trump, like Wallace before him, will eventually exit the scene, the audience members who laughed at his antics and applauded his words won’t.