Police officers on guard outside the wake for the fallen NYPD officer Wenjian Liu drew to attention and saluted New York mayor Bill de Blasio on Saturday, as he arrived for the open-coffin viewing before Sunday’s funeral.

But a week after many officers turned their backs on the mayor at the funeral of Liu’s fellow officer Rafael Ramos, the half-dozen officers at the funeral home in Brooklyn appeared to hesitate as de Blasio approached the entrance where they were posted.

For several tense moments as the mayor mounted the steps in freezing rain, nothing happened and the officers stood loosely. At the sound of a short command, although not in unison, they straightened and brought their white-gloved hands up to salute the mayor.

Liu and Ramos were shot dead at point blank range on 20 December, as they sat in their patrol car in the Bedford-Stuyvesant neighbourhood of Brooklyn. Their killer, troubled 28-year-old Ismaaiyl Brinsley, had made statements on social media linking a desire to kill police with the deaths last summer of two unarmed black men, Michael Brown and Eric Garner, at the hands of white officers.

On Saturday, de Blasio ran a gauntlet of dozens of other police officers lining up to enter the Aievoli Funeral Home in Bensonhurst, Brooklyn, not far from Liu’s home. But unlike at Ramos’s funeral or a graduation event on Monday, when police booed and heckled de Blasio, there was no blatant display of hostility.

Relations between the mayor and rank-and-file police have disintegrated since the shooting of Liu and Ramos, following tension over the national issue of police violence and accountability that has been rising since the summer.

Police commissioner Bill Bratton on Friday firmly requested that officers not turn their backs on the mayor again at Liu’s funeral on Sunday.

Wenjian Liu was shot dead on 20 December. Photograph: AP

Officers gathering for Liu’s wake on Saturday expressed emotions ranging from sadness to defiance.

“I don’t know yet,” said officer Terrence Ainoo when asked if he would turn his back on de Blasio at Sunday’s funeral. He called the killing of Liu “terribly sad”.

“I can see where they are coming from,” said sheriff’s deputy Danny McFarland, of Maricopa County, Arizona, about the NYPD officers’ silent protest at Ramos’s funeral. McFarland and a fellow officer had traveled from Phoenix, Arizona, to be part of the honor guard for Liu at the wake and at Sunday’s funeral.

“Our sheriff would back us,” he said. “If we do our jobs, our boss backs us to the full and if the state cannot find any crime then it’s fair to say they [the officers involved in the death of Eric Garner, who was placed in an illegal chokehold] did not do anything wrong and in that situation the mayor should back the cops,” he said.

He also declined to say if he would turn his back at the funeral on Sunday, if NYPD officers decided to do so again.

Bratton arrived at the wake on Saturday on the stroke of 1pm, as it began, but stood outside in the worsening rain, talking with NYPD first deputy commissioner Ben Tucker and senior police officers, apparently waiting for the mayor to arrive. De Blasio’s car pulled up at 1.15pm and, in a show of unity, the mayor, the commissioner and his wife and the borough president entered the funeral home together.

Last week, Bratton posthumously promoted Liu and Ramos to the rank of detective.

Handmade posters outside the funeral home read “We ‘heart’ NYPD”, with stars and strips flags draped alongside, and “Hero Det. Liu”, written inside the depiction of a police shield. Blue police ribbons tied in rosettes were affixed to the outside of the funeral home.

Officers waited in the rain outside then filed inside and past the casket. Inside the funeral home, they described the atmosphere as silent and sombre. The room where Liu lay in uniform in an open casket was filled with flowers, including a blue, white and golden NYPD police shield depicted in flowers. Many fellow officers of Asian heritage bowed before the coffin, one police officer noted.

Members of his family walked into the funeral home together, dressed in black rainwear, shortly before the mayor and the commissioner arrived. Separate areas had been set aside for police and family.

De Blasio was reportedly meeting Liu’s widow and parents as he paid his respects. He emerged from the funeral home with Bratton after a visit lasting approximately 13 minutes. They got into official cars and were driven away without making any public remarks.

New York governor Andrew Cuomo and congressman Peter King – a fierce critic of de Blasio over his relations with the police – also attended the wake, and also avoided the media.

NYPD officers line to attend a wake for fellow officer Wenjian Liu at a funeral home in Brooklyn. Photograph: Jewel Samad/AFP/Getty Images

De Blasio and Bratton held hours of talks with police unions this week, trying to repair relations that have unraveled since the summer. Despite the talks, which also focused on unresolved contractual issues, the rift between the police and the mayor continues.

Amid large-scale protests in New York and elsewhere over the deaths of Brown, Garner and other black men and grand jury decisions not to indict the officers involved, De Blasio angered many in the NYPD when he said he had warned his biracial son, Dante, to beware of the police. The mayor also refused to endorse a grand jury’s decision not to indict the police officer responsible for the choking death of Garner, a Staten Island resident.

Two officers who were prepared to speak outside Saturday’s wake on condition of anonymity told the Guardian they would not turn their backs on Sunday and did not think other police should either.

“I agree with what the commissioner said that this is about grieving, not grievance,” said one. “It’s disrespectful to the family to turn away – and also the mayor is doing the best job he can to walk a fine line between the rank and file cops and the public, here.”

Another said de Blasio’s warning to his son to be very careful in his dealings with the police – including words to the effect that if stopped he should not to reach for his phone, in case he was mistaken for a criminal reaching for a gun – was “just common sense”.

Both officers described the deaths of Ramos and Liu as “an assassination” and said they were still feeling a sense of shock. The officers were killed simply on the basis of their uniform.

“It’s made me paranoid when I’m in my vehicle,” said the first officer. “There’s a lot of fear. We are being encouraged to talk about it amongst ourselves. There’s no way of knowing if you could be next.”

On New Year’s Eve, a NYPD union chief said a controversial unofficial “slowdown” of work by officers concerned for their safety was “understandable”.

On Saturday, as snow began to fall, residents in the vicinity of the funeral home stepped out from their doors to watch preparations for the wake.

“What I hope for in 2015 is peace and a coming together of the mayor, the cops and the city, and an end to the racism and the bullshit,” said Lisa Gregg, 45, a housewife living on 65th Street in Bensonhurst, yards from the funeral home.

“It’s wrong that the innocents have to suffer, “ she said of the fallen officers. “Half my family is NYPD cops, aunts, uncles, cousins,” she added.

Gregg said both sides needed to compromise. She said Mayor de Blasio should not have made the comments he did in relation to his son and “should apologise”, but added that the police gesture of turning their backs on him was “absolutely wrong”.

Bensonhurst has become less dominated by Irish and Italian residents in recent decades and much more Chinese in culture, which Gregg said made for a good, peaceful area. “The Chinese residents are very quiet. I understand officer Liu is having a Buddhist funeral and I think that’s very interesting cultural event in this city,” she said.

An officer cries as she leaves the wake for Wenjian Liu. Photograph: Carlo Allegri/Reuters

Resident Lisa Chen, 50, spoke in Chinese as she passed the wake to say she was Taishan – the same region of southern China as Liu, whose family moved to the US in 1994. “No one is happy,” she said, gesturing to the residential streets around the funeral home, where people stood to watch events.

Officer Wayne Lok, of the San Francisco Police Department, flew in on his weekend off to attend the wake and funeral. He said he was born in Hong Kong.

“Even people who are anti-police call the police when something happens,” he said. “People are just lashing out at law enforcement at the moment.”

He said he imagined he had similar motivations to Liu in becoming a police officer. “It’s how you are raised with a respect for community and it’s an honourable profession,” he said. “Though a lot of times it’s a thankless task.”

Lok said he thought Daniel Pantaleo, the NYPD officer who went before a grand jury for the death of Eric Garner, had been afforded “due process”. However, he was not prepared to turn his back on de Blasio.

“I’m not going to do that,” he said. “I will remain neutral.”