WASHINGTON – The Senate voted to confirm Gina McCarthy as the new administrator of the Environmental Protection Agency, ending what had been the longest delay for any of President Obama’s second-term Cabinet picks.

The 59-40 vote was the second such successful confirmation vote Thursday, as the Senate follows through on a deal this week to advance long-stalled executive branch nominations.

Obama announced McCarthy as his pick for the EPA post on March 4, when he also nominated Ernest Moniz to be secretary of Energy. Moniz was unanimously confirmed in May.

Republicans blocked McCarthy’s nomination as they sought answers to what they called “transparency requests” from the Obama administration over its environmental policy. Her status became part of a showdown between Senate leaders over delaying tactics that was resolved this week.