PORTLAND, Ore. — Portland police on Thursday released records showing a lieutenant communicated with opposing groups of protesters involved in dueling demonstrations in 2017.

The new records come a week after Willamette Week and Portland Mercury detailed friendly text messages between Lt. Jeff Niiya and Patriot Prayer leader Joey Gibson. Mayor Ted Wheeler called the texts "disturbing" and ordered an independent investigation "to review the existence of bias in the actions of the Portland Police Bureau leading up to and during demonstrations involving alt-right and anti-fascist protesters."

RELATED: Wheeler orders independent investigation over police texts with Patriot Prayer leader Joey Gibson

Niiya was the commander of the Portland Police Bureau's Rapid Response team. He has since been ordered to stop talking with event organizers and removed from the rapid response team until an investigation is completed.

The new records released by police on Thursday show Lt. Niiya communicated with opposing groups in order to prevent violence at dueling 2017 rallies. Patriot Prayer and anti-fascist protesters were at the downtown Portland rallies on June 4, just nine days after witnesses and police said a self-proclaimed white nationalist hurled hate speech at two young women on a MAX train and attacked three men who tried to intervene, leaving two of them dead.

One of the rallies, called “Portland Stands United Against Hate,” was referred to as peaceful by Lt. Niiya, records show. Text messages between Lt. Niiya and leaders of that rally show he gave updates on masked protesters moving toward their group and he advised them to stay safe.

Lt. Niiya also communicated with antifa protesters. Records show he wrote to one, “I have warned the patriots if they try and come across the street to Chapman they will be arrested. I know you and your friends do not like us, but I am really trying my best to keep the police just in between and allow everyone to voice their opinions.”

In another exchange, Lt. Niiya said, "I am doing my best as is our command staff to just be a barrier between all groups. We would rather not engage outside of keeping people safe by not allowing weapons in the crowds as best as we can. Please feel free to message me or use me to communicate concerns."

In response, the protester wrote, "Just don't stare us down with the terrorist gear you guys wear. It will escalate people on our side. Focus on them. We are not the enemy. We live here."

Read the documents

The union representing Portland Police commanding officers said there was nothing inappropriate about the text messages between Lt. Niiya and Gibson, and filed a complaint against Mayor Ted Wheeler and Commissioners Chloe Eudaly and Jo Ann Hardesty. The complaint alleges all three city leaders made public comments that constitute workplace harassment, discrimination and retaliation.

RELATED: Police union files complaint over response by city leaders to texts with Patriot Prayer leader

A community listening session is being held Thursday night in response to Lt. Niiya's texts with Gibson.The goals of the session at the Maranatha Church are to hear concerns and solutions from the public, Portland police said. Mayor Wheeler and Chief Outlaw will be there.