Patrick McDonnell, who has served as secretary of the Pennsylvania Department of Environmental Protection for the past six years, is leaving the post on July 2.

He will be replaced by Ramez Ziadeh, executive deputy secretary of programs. Mr. Ziadeh, another DEP veteran, will become acting director when Mr. McDonnell departs.

Mr. McDonnell has 25 years of service in state government. He has been with the DEP since 1998 and, before that, served as executive policy manager at the Pennsylvania Public Utilities Commission.

Gov. Tom Wolf said in a statement that he is grateful for Mr. McDonnell’s contribution to the state.

“Through his leadership, we are taking significant action to address climate change, reduce greenhouse gas emissions, protect our waterways, and ensure that contaminated lands are cleaned up and repurposed so that our communities can enjoy these spaces once again,” Mr. Wolf said.