WASHINGTON — The Commerce Department plans to shut down a little-known internal security unit that came under scrutiny by Congress for conducting rogue surveillance and investigations into people of Chinese and Middle Eastern descent, department officials said on Friday.

The announcement came after department investigators released the findings of a nearly five-month internal review that concluded that the Investigations and Threat Management Service improperly opened investigations “even in the absence of a discernible threat” and operated outside the bounds of its legal authority.

It also confirmed a central finding of a parallel inquiry by Republicans on the Senate Commerce Committee, who reported in July that officials in the unit had searched employees’ email accounts for terms written in Chinese characters as broad as “thousand,” ostensibly to root out employees who were being recruited as spies by Beijing. But unlike the Senate investigation, the Commerce Department stopped short of attributing the problems to racism or xenophobia inside the unit.

“We are committed to maintaining our security, but also equally committed to protecting the privacy and civil liberties of our employees and the public,” Gina Raimondo, the commerce secretary, said in a statement announcing the shuttering of the office.

Senator Roger Wicker of Mississippi, the top Republican on the Commerce Committee, who released a report in July detailing how the security unit had functioned for more than a decade as “a rogue, unaccountable police force,” said in a statement that he was “encouraged by the actions taken by Secretary Raimondo to correct the egregious misconduct within the Commerce Department.”

But he added that he would continue to investigate “why the department’s inspector general previously failed to address” earlier allegations.

The 26-page report released by the department on Friday painted a picture of an overzealous unit that “did not possess adequate legal authority to investigate the array of criminal activity it sought to address.”

“Over many years, I.T.M.S. would be sent select correspondence for review, regardless of whether it posed a threat,” investigators wrote. “I.T.M.S. would then open an intake in relation to the correspondence, even in the absence of a discernible threat.”

That correspondence, whistle-blowers told The New York Times in July, included social media posts online, such as those critical of changes made to the census.

Agents would then “run the names of the author or others associated with the correspondence in various databases in search of any relevant information about the person (often there was none),” the department said in its report. Hundreds of the 1,945 cases the unit had open fit that pattern, investigators found, the “vast majority, if not all” of which should have been closed.

Though agents with the unit “sometimes ran names through classified databases to learn about an individual’s background,” investigators said they did not find any procedures “establishing standards for engaging in this activity.”

Investigators were more circumspect about allegations that the work of the office, fueled by concerns about rampant Chinese espionage in the United States, sometimes veered into racial profiling.

Department investigators wrote that they did not find “any firsthand or documentary evidence that racial, ethnic or national origin bias motivated any specific cases.” The Senate report released in July, based in part on reports by whistle-blowers, asserted that the unit’s work had been discriminatory.

A Rise in Anti-Asian Attacks

A torrent of hate and violence against people of Asian descent around the United States began last spring, in the early days of the coronavirus pandemic.