Puerto Rico’s disgraced Gov. Ricardo Rossello officially stepped down from office on Friday night — and his last act was to swear in veteran politician Pedro Pierluisi as his successor.

The new governor’s fate remains ­unclear, however, as Pierluisi himself conceded following his swearing in, in his first news ­conference.

To render him eligible for the governorship, Rossello had first appointed Pierluisi as secretary of state.

The appointment was approved after a heated battle by Puerto Rico’s House of Representatives, which is controlled by Pierluisi’s New Progressive Party.

But Pierluisi, who made many enemies — as former advisor to the hated, federally-created board the that supervised Puerto Rico’s bankruptcy — is far less popular in Puerto Rico’s Senate, which also must confirm him.

Already, Senate President Thomas Rivera Schatz has termed Pierluisi’s appointment “unethical and illegal.”

Pierluisi told reporters that the territory’s Senate would meet Wednesday to vote on whether to confirm him as governor.

“The Senate will have its say and by the end of Wednesday we’ll know whether I am ratified,” said Pierluisi, who until last week was a corporate attorney for Washington law firm O’Neill & Borges.