In a response to the recent attention from the news media, Mr. Gibson said in a Facebook video that his communications with Lieutenant Niiya were similar to those he engaged in with police officers in other cities where he organized rallies.

“Most of the police officers I talk to are very respectful,” Mr. Gibson said. “It doesn’t mean that they like me. It doesn’t mean that they back me. But they’re very professional and they want to basically do everything they can to de-escalate things whenever possible.”

Lieutenant Niiya did not comment on the investigation but referred questions to the Portland Police Commanding Officers Association. The union’s president, Lt. Craig Morgan, said that the police were focused on keeping people safe.

“We work with groups from all sides, regardless of how we may personally feel about any of those individuals or groups,” he said. “Some groups are more willing to engage with the police than others.”

Lieutenant Morgan added that officers regularly communicated with the mayor’s office about their policing tactics. “This situation is no different,” he said. “Mayor Ted Wheeler’s statement about our communications with Patriot Prayer organizers is either disingenuous or shows willful ignorance of the situation.”

In the past, Lieutenant Niiya has exchanged similar text messages with an activist on the left who provided medical care for antifa protesters, according to a series of texts reported on by Willamette Week and The Oregonian in 2017. The activist was ostracized from the group when those texts became public.

After the texts with Mr. Gibson were disclosed, the police chief, Danielle Outlaw, said in a statement on Thursday that she had called for an internal investigation of their content and context. “The Portland Police Bureau has strong organizational values that encompass integrity and accountability,” she said. “We have also pledged transparency to our community.”