Hundreds of people cowered for more than an hour at a shopping centre in the Mexican resort town of Cabo San Lucas while security forces traded fire with gunmen outside, then searched for them in stores.
No injuries were reported from the gun battle, which damaged some cars and entrance doors.
Police arrested two men suspected of being involved in an overnight attack near the centre that killed a Mexican marine.
Authorities say the shooting at the Plaza Sendero shopping centre erupted when marines, soldiers and police found armed men in the car park. Police ordered shoppers to stay inside during the shooting and later search. People were allowed to leave an hour later.