Puerto Rico’s outgoing governor defied top lawmakers and swore in his preferred successor Pedro Pierluisi, likely setting up the island territory for further leadership confusion and a legal battle for political power.

Ricardo Rosselló named Mr. Pierluisi, a member of his pro-statehood New Progressive Party and a former Democratic representative for the island in Congress, to be Puerto Rico’s 13th governor.

But his hold on power was tenuous as he faced questions about his legitimacy, division within his party and a galvanized public suspicious of political insiders.

“I assume this responsibility with the utmost respect for our people and our system of government,” Mr. Pierluisi said at a news conference Friday evening after being sworn in.

Mr. Rosselló, who officially exited as governor at 5 p.m. Friday, became Puerto Rico’s first sitting governor to resign. Mr. Pierluisi was confirmed to the secretary of state position Friday afternoon, the next in the line of succession, by Puerto Rico’s House of Representatives but not the Senate.