Brazilian police have shot dead a suspected drug trafficker who stunned Rio de Janeiro by pulling off a violent escape from a hospital.

A police statement says 28-year-old Nicolas Labre Pereira and two other unidentified men were killed after exchanging fire with a special force in a mangrove forest outside the city Monday.

Pereira escaped from custody at a downtown hospital June 19 after nearly 20 gunmen stormed the building. A patient was killed, and a nurse and an off-duty policeman were wounded.

The hospital was one of those recommended for any tourists needing medical care, and the incident raised concerns about security less than two months before the Olympic Games kicked off in Rio.

More than 10 people were killed in shootouts caused by the subsequent hunt for Pereira.