FBI Director Christopher A. Wray decried the government shutdown’s impact on the bureau’s employees in a video message released amid rising anxiety among thousands of agents and other personnel who have spent more than a month working without pay.

In the unusual video message, Wray also offered a seeming apology for why the FBI’s top officials were not publicly arguing for their employees, suggesting that they have not spoken out because of the repeated political criticisms of the bureau from President Trump and others in recent years.

“You know better than most that we’ve been thrust into the political spotlight more than we would have liked over the past few years,” Wray said in the message, which was directed to FBI staff. “And the last thing this organization needs now is its leadership to wade into the middle of a full-on political dispute.”

The comments from Wray came as federal law enforcement officials across the government have expressed anger at the lack of paychecks during the shutdown and concerns that the situation was hindering their work. The Justice Department said most of its employees had to keep working during the shutdown, including nearly 90 percent of the 35,000 people who work for the FBI. These workers received no paychecks, although government officials said they would receive back pay when the shutdown ended.

Wray used his message to highlight the financial strains faced by bureau employees who still need money for rent and groceries. Some employees at FBI field offices have discussed setting up food banks, while other law enforcement officials — along with unpaid workers across the government — weighed leaving the government and struggled with how to pay upcoming bills amid the uncertainty.

“Making some people stay home when they don’t want to, and making others show up without pay, it’s mind-boggling, it’s shortsighted and it’s unfair,” Wray said. “It takes a lot to get me angry, but I’m about as angry as I’ve been in a long, long time.”

Law enforcement officials have also described effects on their work, including an inability to approve travel or cash, a lack of money for informants, and no cash for some criminal investigations.

Earlier in the week, the FBI Agents Association released a report arguing that the shutdown was curbing the ability of agents to “perform [their] duties and fund necessary operations and investigations.”

Thomas O’Connor, president of the association, said in a statement that Wray’s video message “clearly articulated the challenges confronting” the FBI’s employees.

“As we have said, the director and the FBI leadership are doing all they can to fund FBI operations with increasingly limited resources,” O’Connor said.

Congressional leaders and Trump reached a tentative deal to temporarily reopen the government Friday.

Wray, the head of the nation’s premier law enforcement agency, acknowledged that “there’s some question about why you haven’t seen the FBI leadership out there in the press, fighting the good fight over the past five weeks.”

Wray said FBI officials were agitating privately, not publicly, and linked that decision to the political controversies that have entangled the bureau recently.

Trump, who picked Wray to lead the bureau after firing former director James B. Comey, has repeatedly criticized the FBI and Justice Department over the ongoing Russia probe and other issues. His conservative allies have similarly pilloried these law enforcement agencies. Before Trump took office, Comey held a controversial 2016 news conference to announce that he would not recommend charges against Hillary Clinton over her use of a private email server while secretary of state.

In his message about the shutdown, Wray argued that “there are real costs” to having FBI officials speak out in the media, adding: “In this polarized environment, even seemingly straightforward statements can be hijacked by one side or the other.”

Wray told employees that FBI officials had been “actively advocating for you” behind the scenes, including seeking a way to make a one-time payment to many employees that fell through. He thanked the employees who were sharing job duties and organizing ways to donate food and other goods while continuing to work.

“In spite of it all, you’re still doing what the American people need you to do,” he said.