LeRoy S. Zimmerman, the powerful Pennsylvania Republican whose oversight of the sprawling Hershey organization is under investigation by the state Office of Attorney General, is retiring from the multibillion-dollar charity at the end of this year, the Hershey Trust Co. said in a surprise announcement Monday.

Hershey Trust spokeswoman Connie McNamara said Zimmerman's resignation "is not in any way related to the OAG matter."

The investigation was announced after The Inquirer reported that funds meant for the Hershey School for impoverished children had been spent on a money-losing golf course. The $17 million project bailed out the wealthy owners of the course, one of whom was the chief executive officer of the Hershey chocolate company and a member of the charity's board that approved the expenditures.

The Hershey Trust said in a statement that Zimmerman initiated "the first phase of his retirement plan" when he opted not to seek reelection to the board of the Hershey chocolate company, which was disclosed in a corporate regulatory filing in February.

Neither Zimmerman nor the charity disclosed at the time his intention to relinquish all his Hershey-related board positions. McNamara said Zimmerman "wanted to remain an active chairman of the organization and did not publicly announce his retirement until now."

He is chairman of the boards for the Hershey Trust Co., the Board of Managers of the Hershey School, and Hershey Entertainment & Resort Co. He also is a board member of the M.S. Hershey Foundation.

He is retiring from the board positions, according to the statement.

Milton and Catherine Hershey created the charity in 1909 as a school and orphanage. It is controlled by the complex of boards and endowed with Hershey's immense wealth, now valued at about $7.5 billion. The free school for impoverished children, the sole beneficiary of the estate, enrolls 1,850 boarding students and is 90 miles west of Philadelphia on the Pennsylvania Turnpike.

Zimmerman, who has headed the organization since 2006, had a year remaining in his tenure. The charity's main board, the one for the Hershey Trust, is expected to elect a new chairman at its annual meeting in December.

The Hershey Trust is a small, state-chartered trust bank designated by Milton Hershey to manage the assets of his estate.

Nils Frederiksen, spokesman for the Attorney General's Office in Harrisburg, did not return phone calls or e-mails asking how Zimmerman's retirement could affect the investigation that was launched in 2010 by then-Attorney General Tom Corbett, now governor. Corbett and Zimmerman are friends and political allies. The Attorney General's Office is now headed by Corbett-appointee Linda Kelly.

Corbett spokesman Kevin Harley, in an e-mail response, had no comment.

Zimmerman, the state's first elected attorney general in the early 1980s, cited age in his decision to retire from the Hershey boards. "I am deeply proud of what we have accomplished, especially the many additional children we have been able to serve. But I am 77 years old," he said, "and it is time for me to retire."

His time at the Hershey organization was "one of the highlights of my life," Zimmerman said, and a period during which the school expanded to a historic high of 1,850 students from 1,250 students.

During his leadership, the school implemented changes to better prepare graduates for post-school life, and the school returned to a "strong focus on career technical training," according to the Hershey Trust statement. Zimmerman did not respond to a phone call to his Harrisburg office with the Eckert, Seamans, Cherin & Mellott L.L.C. law firm.

In 2010, The Inquirer began reporting on what seemed to be questionable expenditures of Hershey School funds. Along with the purchase of the Wren Dale golf course, the board bought an adjacent roadside attraction, called Pumpkin World. The two transactions amounted to about $25 million, a figure well above their market values.

School officials have said the land purchases provided a buffer zone for student safety and could be used for future expansion for student homes.

Robert Reese, the former president of the Hershey Trust, filed a petition in Dauphin County Orphans' Court in February that said the posh charity-owned Hotel Hershey underwent a $70 million upgrade that was opposed by the hotel's business managers "because the investment would never have a payback to justify it." Among the new amenities: an infinity-edge swimming pool, 10 private cottages, a year-round skating rink, and a 130-seat restaurant.

A photo around the time that the expansion was completed shows Zimmerman and other trustees at the doors of the hotel. A banner draped over their heads reads "Zimm's Palace." The trustees stayed overnight at the hotel during board meetings.

In court filings, the Milton Hershey School and the Hershey Trust said that Reese was being vindictive because he had not been reelected to the charity's boards. In April, Reese withdrew his petition claiming financial abuses in the charity, citing his deteriorating eyesight.

In July, The Inquirer reported that Zimmerman earned an aggregate $1.9 million since 2003 in part-time director fees on Hershey-related boards.

For more coverage of the Hershey Trust, go to www.philly.com/hershey