Cops from across the country paid respects to assassinated hero cop Wenjian Liu at his Brooklyn wake Saturday — including Mayor Bill de Blasio, who breezed in and out without prompting any protest.

The mayor had a lone police escort into the crowded gathering — Police Commissioner Bill Bratton.

The commissioner had waited outside the Aievoli Funeral Home in Dyker Heights for 20 minutes before de Blasio arrived at 1:12 p.m. The two entered the front door together, to the white-gloved salute of eight dress-blue-clad officers, well out of sight of hundreds of cops queued up at a side entrance.

After just 15 minutes inside, Hizzoner left alone, again out of sight of the throng of officers still waiting to enter the wake.

“It just shows that de Blasio is worried and he’s stacking the deck to protect himself and his image,” one law-enforcement source said of the mayor’s media-savvy decision to enter the wake quickly, quietly, away from the blue wall of resentment, and with “bodyguard” Bratton in tow.

“Bratton will do anything to help him,” the source added.

Visitors to Liu’s wake included a contingent of police officers from San Francisco and the LAPD, and Gov. Andrew Cuomo, who is himself planning a funeral — for his father, former Gov. Mario Cuomo.

“They were newlyweds,” the governor said of Liu, 32, and his widow, Pei Xia Chen.

“They had just had moved into their home, just had started the American dream. His parents were living with them, and just a few months into the marriage she is a widow,” Cuomo told reporters after paying his respects.

Inside the funeral home, Liu lay in his dress uniform in a cherry wood coffin, flanked by the American and NYPD flags and well over 100 flower arrangements.

The choking cries of his widow and parents were audible from across the room. Dozens of his fellow officers from northern Brooklyn’s 84th Precinct sat facing the coffin in solemn silence.

In the weeks since Liu and partner Rafael Ramos, 40, were ambushed Dec. 20 on a Bedford-Stuyvesant street, angry officers have displayed outrage to their perceived, anti-cop mayor by literally turning their backs on him as he passed them in a hospital hallway and as he spoke at Ramos’ funeral last Saturday.

And while no officers turned their backs on the mayor at Liu’s wake Saturday, cops were plotting online to do so at the slain officer’s funeral Sunday, despite an NYPD-wide directive by Bratton that “a hero’s funeral is about grieving, not grievance.”

“There will be someone signaling an ‘ABOUT FACE’ via bullhorn,” one poster who used the handle “BrutalObserver” wrote on Thee Rant blog. “If and when you hear this loud ABOUT FACE everyone… and I mean everyone is expected to face away from the funeral home.”

“Sympathetic friends in IAB [Internal Affairs Bureau] and Brooklyn inspections have already confirmed that they will be sending an ample contingency of rat observers to the funeral armed with pen and pads,” the poster warned.

Officers who are “on the fence” about protesting can wear their raid jackets over their uniforms, the poster suggested. “This way you are identified in the press but the rats in the crowd can not write down your shield number.”

Bratton has said he won’t punish officers who again disrespect de Blasio, but has said such behavior is “inappropriate.”

Liu’s funeral will include a Chinese ceremony led by Buddhist monks, followed by a traditional police ceremony with eulogies led by a chaplain. Burial will follow at Cypress Hills Cemetery, where his partner was laid to rest last week.

“It’s not uncommon for a wake,” spokesman Phil Walzak said of the mayor’s quick departure from Saturday’s gathering. “He paid his respects to the family.”

Additional reporting by Khristina’s Narizhaya and Stephanie Pagones and Aaron Short.