Federal prosecutors in Manhattan struck a deal earlier this summer with Allen Weisselberg, the longtime chief financial officer of the Trump Organization, granting him immunity for his grand jury testimony about Michael D. Cohen, a person briefed on the arrangement said Friday.

News of Mr. Weisselberg’s testimony came days after Mr. Cohen said Mr. Trump had directed him to commit campaign finance crimes and one day after another Trump loyalist, the tabloid executive David Pecker, was revealed to have agreed to help prosecutors in their case.

The person briefed on the deal said that it was narrow in scope, protecting Mr. Weisselberg from self-incrimination in sharing information with prosecutors about Mr. Cohen, Mr. Trump’s former personal lawyer, who pleaded guilty on Tuesday to tax and campaign finance charges. The latter charges stemmed from payments during the campaign to two women who said they had affairs with Mr. Trump. It was not, the person said, a blanket immunity extending beyond the information he shared, and Mr. Weisselberg remains in his job at the Trump Organization.

Mr. Weisselberg figured into the charges filed against Mr. Cohen this week, having facilitated the processing of what prosecutors described as “sham invoices” at the Trump Organization, through which Mr. Cohen was reimbursed for the money he had paid to quiet one of the women alleging an affair with Mr. Trump, the pornographic film actress Stephanie Clifford.