– Republicans gathered for their national convention offered staunch support of police this week, and thanked officers from across the country who provided security amid heightened tensions after a string of fatal shootings of police and police shootings of black men.

“We feel very, very loved and supported,” said detective Edward Zigman, a 32-year law enforcement veteran with the Mentor, Ohio, police department, the local agency assigned to the Minnesota delegation. “We’ve received hugs, handshakes and thanks. It’s very overwhelming. It’s a great feeling.”

Republicans’ lockstep support of law enforcement on the national stage comes as both parties are trying to win support from powerful police unions, groups that have played defining roles in the election of candidates from both parties. Republicans are also trying to draw attention to Democrats who raise questions about police actions or have aligned with activists from Black Lives Matter after recent police shootings.

Hundreds of officers from across the country patrolled downtown Cleveland all week. On horseback, bike and foot, they roamed inside and outside the heavily guarded perimeter set up around Quicken Loans Arena. Many wore black ribbons over their badges, in honor of three Baton Rouge, La., police officers killed Sunday by a gunman angry over fatal police shootings of black men.

In a scene that repeated throughout the convention, a man stood and applauded as a phalanx of stone-faced police officers marched near the entrance of the arena. “We appreciate y’all,” the man said.

GOP presidential nominee Donald Trump positioned himself firmly as the candidate of law and order.

He earned raucous applause Thursday night when he denounced the recent killings of police officers in Dallas and Baton Rouge, saying: “An attack on law enforcement is an attack on all Americans.” He promised that “When I take the oath of office next year, I will restore law and order.”

For years, both parties have heavily courted police unions. The unions have poured millions of dollars into campaigns as they have fought to block tough new regulations, such as curbs on racial profiling, and at the same time pushed for additional tax dollars to hire more cops, improve training and buy equipment.

Republicans have tried to frame concerns raised by President Obama and other Democrats after fatal shootings of black men as disloyal to police.

As party officials convened in Cleveland to revise the GOP’s document of guiding principles, party leaders crystallized criticism of Democrats they say have made law enforcement’s job more dangerous.

“The men and women of law enforcement … deserve our gratitude and support,” the party platform states. “Their jobs are never easy, especially in crisis situations, and should not be made more difficult by politicized second-guessing from federal officials,” citing “the current administration’s lack of respect for them.”

Andy Aplikowski, a member of the platform committee, introduced and helped adopt the language. “You see what’s happening with some of the politicians,” said Aplikowski, a delegate from Andover. “They’re twisting [these shootings] out of proportion. Supporting law enforcement, as Republicans are saying they’re doing, it’s not condoning bad actors.”

The debate is playing out vividly in Minnesota as Republican legislators have proposed a rare public rebuke of DFL Gov. Mark Dayton for saying that Philando Castile, who was killed by police during a Falcon Heights traffic stop, would be alive today if he were white.

“No elected representative should make the kind of incendiary remarks Governor Dayton made when he accused police officers of racism before the facts were known,” said Sen. Bill Ingebrigtsen, R-Alexandria, a retired sheriff. “Premature, reckless accusations fan the flames of intolerance and fear and lead to even more violence.”

Some Democrats have criticized Republicans for implying politicians must choose one side or the other and say that raising questions about isolated incidents does not indicate a lack of support for police.

Dayton, for instance, has won strong backing from law enforcement.

After demonstrators angry about Castile’s shooting attacked police earlier in July, Dayton praised their “heroic efforts” and thanked them for “their professionalism and persistent attempts to resolve the situation peacefully.”

In Mentor, the police officers assigned to the Minnesota delegation provided round-the-clock security. Wednesday night, as music blared in the hotel bar, one delegate took a microphone and thanked the officers standing in the back of the room, including detective Zigman, saying “Blue lives matter!”

Zigman said he hasn’t seen this level of support since 9/11.

“I believe that the Republican Party and their principles are a law-and-order party,” he said. “I’m sure that the Democratic Party also has ideas, but the Republican Party seems like a very strong, and staunch supporter of the Constitution and everybody’s rights — not just Republicans — but everybody’s rights.”