Image copyright EPA Image caption Wanda Vázquez, left, was sworn in with her husband and daughter by her side

Puerto Rico's Justice Secretary Wanda Vázquez has been sworn in as the US territory's new governor, hours after her predecessor was forced to stand down by the Supreme Court.

She is the third politician to occupy the post in less than a week.

Ricardo Rossello resigned on Friday after street protests prompted by the leak of offensive messages.

His replacement, Pedro Pierluisi, was removed by the Supreme Court on constitutional grounds after five days.

Ms Vázquez has promised to bring political stability to Puerto Rico, which was devastated by Hurricane Maria two years ago.

She had publicly stated that she was not interested in becoming governor but was next in line to Mr Pierluisi, according to the constitution.

In a statement released after her swearing-in, she said she was assuming office "with the greatest respect and determination to serve my people and to push Puerto Rico forward".

Her inauguration came after Supreme Court justices ruled that as the Senate had never confirmed Mr Pierluisi, "the assumption of the office of governor was unconstitutional".

Mr Pierluisi has called for unity and urged Puerto Ricans to discard "political-partisan, ideological or personal agendas".

Media playback is unsupported on your device Media caption Ricky Martin gave his support to Puerto Rican protesters

Mr Rosselló had been at the centre of a group text message scandal that had already led two top officials to resign.

The leaked messages revealed sexist, profane and homophobic comments.

The chat, which contained 880 pages of exchanges between the governor and 11 male allies, was leaked on 13 July and led to days of protests outside the governor's mansion in San Juan.