PORT-OF-SPAIN, Trinidad — A new prime minister took office Wednesday in Trinidad and Tobago after the previous ruling party was voted out in general elections.

Keith Rowley was sworn in during a brief ceremony in the Caribbean country’s capital, Port-of-Spain. His People’s National Movement won 23 seats in the 41-member House of Representatives in Monday’s vote, ousting a coalition led by Kamla Persad-Bissessar.

Faris Al-Rawi was sworn in as attorney general, and retired Maj. Gen. Edmund Dillon took the oath as minister of National Security.

Rowley and his party take power as the country wrestles with slowing growth due to falling prices for its principal exports, natural gas and oil.

The former prime minister said she plans to challenge the election results because the voting period was extended by an hour. Officials had extended it because of inclement weather.