A shakeup in the highest echelons of the Port Authority reached all the way to the MTA on Tuesday — with the PA’s chief switching over to the transit agency.

Port Authority Executive Director and Bridgegate figure Pat Foye stepped down from his post at the PA in the morning to assume his new role as MTA president, sources said.

Foye — who famously ordered the lanes at the George Washington Bridge to be reopened after they were closed for political reasons in the Bridgegate scandal — will report to MTA Chairman Joseph Lhota, sources said.

Rider advocates said they believe Foye is a good pick for the job at the agency, which has spiraled into chaos because of increasing derailments and delays caused by aging infrastructure.

“Gov. Cuomo has put in place an experienced team,” said Nick Sifuentes, deputy director of the Riders Alliance. “Now they need him to guarantee the sustainable funding source they need to make good on their promise to fix our subways.”

Following Foye out the door at the PA on Tuesday was the agency’s chairman, John Degnan, who had been clashing with Cuomo recently, sources said. Degnan was not given a new position anywhere, at least not yet.

Degnan was a Gov. Christie appointee to the bi-state agency. Foye was a Cuomo guy, as is Lhota.

The departure of both Degnan and Foye from the PA provides a new slate at the agency that both governors can live with, according to sources.

Gov. Cuomo’s trusted special counsel, Rick Cotton, will replace Foye, while former New Jersey legislator Kevin O’Toole is replacing Degnan, officials said.

Cotton and O’Toole will resume the search for a Port Authority CEO and will oversee major projects, including the new La Guardia Airport, renovations at JFK and plans for a new bus terminal, officials said.

Sources said Degnan was pushed out for criticizing the mayor over the search for a new CEO. Last month, Degnan told a media outlet that the governor wouldn’t approve anyone he found for a new CEO position. He had also called the CEO search a failure, while Cuomo prides himself on getting the job done, no matter how difficult a task, sources said.

Meanwhile, the Cuomo administration has repeatedly blasted Degnan for failing to institute oversight at the beleaguered agency.

Foye had expressed a desire to leave the Port Authority for more than a year but stayed on to see Degnan out, sources said.

“Foye wasn’t going to leave until Degnan did,” a source noted.

In addition to Foye’s new post at the MTA, longtime transit-agency honcho Ronnie Hakim will be named managing director of operations, sources said. She will report to Lhota, who in June reclaimed the role he left in 2013.