McKinsey & Company, the prominent management consultancy, has stopped working for Immigration and Customs Enforcement after the disclosure last month that the firm had done more than $20 million in consulting work for the agency. The revelation prompted questions from employees at the firm.

[Update: How McKinsey helped ICE under the Trump administration.]

McKinsey’s decision was conveyed in a note from the firm’s new managing partner, Kevin Sneader, to former employees. He said the contract, which was not widely known within the company until The New York Times reported it in June, had “rightly raised” concerns.

While stating that McKinsey’s work for the agency did not involve carrying out immigration policies, Mr. Sneader wrote that the firm “will not, under any circumstances, engage in any work, anywhere in the world, that advances or assists policies that are at odds with our values.”

Complaints about the contract come at a time when McKinsey is under fire in South Africa for its role in a vast government corruption scandal that led to the resignation of the country’s former president, Jacob Zuma. The resulting crisis at McKinsey, the most serious in its 92-year history, was the focus of The Times’s article. On Monday, in a speech to a business school in Johannesburg, Mr. Sneader apologized to the nation for McKinsey’s handling of the episode.