Four people were wounded in a gunbattle between Brazilian police and armed assailants trying to carry out a robbery on a city bus in Rio de Janeiro, authorities said.

The shootout came after three men commandeered the bus around 8:00 p.m. Tuesday and what began as a robbery turned into a hostage situation.

Three bus passengers and one police officer were injured.

A female passenger was undergoing emergency surgery for a bullet wound to the chest, media outlets said, citing an anonymous source in the municipal health department.

A spokesman for the Rio de Janeiro state public safety office told Efe a police negotiator convinced the robbers to release the passengers.

Two of the assailants - one of them holding a grenade - surrendered to police, but the third managed to flee.

The situation was "resolved very quickly" after two cops were alerted to the presence of armed men on the bus and promptly called for back-up, state police Maj. Mario Sergio Duarte said.