Former House speaker Thomas M. Finneran has been given immunity to testify in the grand jury investigation of the scandal-plagued state Probation Department, say two people briefed on Finneran’s arrange­ment with federal prosecutors.

While speaker, Finneran oversaw the transfer of power to hire probation officers from the judiciary to John J. O’Brien, a protege and jogging partner who was then probation commissioner. O’Brien used that power to ­devise a rigged and fraudulent hiring process, say prosecutors and Paul F. Ware, the independent counsel hired by the ­Supreme Judicial Court to investigate the Probation Depart­ment.

O’Brien and two top aides were indicted in March and face mail fraud and racketeering charges.

After Finneran pushed through the 2001 budget amendment that gave O’Brien nearly complete control over hiring and firing at the 1,800-person agency, the probation budget, set by the Legislature, soared. By 2010, probation ­employed at least 250 people who were friends, supporters, or relatives of politicians and court officials, the Globe Spotlight Team reported in 2010.

Finneran, who is now working as a lobbyist after leaving his radio talk show in May, could potentially detail the ­political maneuvering that turned the Probation Department into a patronage haven. He appeared before the grand jury several months ago, said a person with first-hand knowledge. Neither he nor his lawyer returned phone calls.

Prosecutors have been trying to reconstruct the history of the legislation that gave O’Brien control over probation hiring.

When prosecutors went looking for records related to the budget amendment that made its way through the Legislature, including who sponsored it and if it was changed at all during the process, they could not find any. Representatives of the House clerk’s office were called before the grand jury and asked to explain. The Legislature searched the state archives, but no such documentation could be found, said someone briefed on the effort.

Finneran pleaded guilty in 2007 to obstruction of justice in an unrelated redistricting case and was disbarred.

Federal prosecutors have been investigating the Probation Department since fall 2010, but have been focused in recent months on the politicization of the hiring process. A succession of probation employees has been asked how they got their jobs and whether they were obliged to donate to politicians before or after they were hired to advance their ­careers.

Among the politicians who had been the most successful in getting probation jobs were House Speaker Robert A. DeLeo and one of his former top lieutenants, Representative Thomas Petrolati, his former speaker pro tempore. Former House speaker Salvatore F. ­DiMasi, who is now serving an eight-year sentence on unrelated corruption charges, was also able to get jobs for friends and supporters, according to a sponsors list kept by O’Brien.

DiMasi was called to testify from his prison cell in Kentucky last winter, but he told friends he did not provide anything useful to prosecutors.

Prosecutors have also been investigating allegations by supporters of DeLeo’s 2009 oppo­nent, Representative John Rogers, a Norwood Democrat, that O’Brien helped DeLeo win the speaker’s fight by giving probation jobs to legislators in exchange for their vote, a charge DeLeo has denied.

Last March, a federal grand jury indicted O’Brien and former deputy commissioners Elizabeth V. Tavares and ­William H. Burke III. At the time, US Attorney Carmen M. Ortiz accused them of giving jobs to friends and allies of legislators “to aggrandize power to themselves” and to ­increase the agency’s budget, among other things. The three are awaiting trial.

The federal indictment described the elaborate phony hiring process at the Probation Department, under which thousands of job candidates were interviewed even though they had virtually no chance of getting the job ­because O’Brien and his deputies had selected the winning candidates ahead of time.

O’Brien also faces state charges of holding a fund-raiser for Timothy Cahill when he was state treasurer, so that O’Brien’s wife would be hired at the ­Lottery Commission, an agency under Cahill’s control.