WASHINGTON — The United States military has sharply curtailed the use of psychologists at the prison at Guantánamo Bay, Cuba, in response to strict new professional ethics rules of the American Psychological Association, Pentagon officials said.

Gen. John F. Kelly, the head of the United States Southern Command, which oversees Guantánamo, has ordered that psychologists be withdrawn from a wide range of activities dealing with detainees at the prison because of the new rules of the association, the nation’s largest professional organization for psychologists. The group approved the rules this past summer.

General Kelly’s order is the latest fallout after years of recriminations in the profession for the crucial role that psychologists played in the post-9/11 programs of harsh interrogation created by the C.I.A. and the Pentagon. The psychologists’ involvement in the interrogations enabled the Justice Department in the George W. Bush administration to issue secret legal opinions that declared that the C.I.A.’s so-called enhanced interrogation program was legal, in part because health professionals were monitoring it to make sure that it was safe and that it did not constitute torture.

Anger in the profession about the role of the psychologists helped lead to the new ethics rules.

In 2015, six psychologists were assigned to Guantánamo at a time and given rotating tours of duty, and as many as 12 psychologists served at Guantánamo during the year, according to Col. Lisa Garcia, a spokeswoman for the Southern Command.