Mexican soldiers battled for two hours with armed men believed to be holding police hostage in a house in Acapulco, leaving 16 gunmen and two soldiers dead, the military says.

At least three soldiers and Mexican bystanders were injured in the shootout. Some small hotels were evacuated in the Acapulco neighborhood, which used to be popular with classic Hollywood stars such as John Wayne, but has since fallen out of favour and become rundown.

The battle broke out Saturday night after the military received a tip about a gated home filled with armed men, said the army colonel who led the mission and spoke on the condition of anonymity for security reasons.

Gunmen opened fire at the soldiers when they arrived at the house and hurled about 50 grenades at them. Several gunmen tried to flee in a car but ran into a Humvee that was blocking the exit.

An additional group of gunmen arrived by car to reinforce those in the house, but were killed by the military, the colonel said as he wore a ski mask while leading reporters through the battle scene.

Inside the home, soldiers found four Guerrero state police officers who were handcuffed in the garage.

The police officers, who were still bound and sitting on the floor, told reporters that they were being held captive by the gunmen.

The military did not have any intelligence reports about the police officers capture and said their identities had not been confirmed.

"We found them like this, handcuffed, and they say they were kidnapped. So, if they were kidnapped, as they say, then we rescued them," the colonel said near the bound men.

The military said it was unclear whether the gunmen belonged to one of the drug cartel battling for turf in Guerrero state.

One drug cartel, the Beltran Leyva cartel, has a heavy presence in Acapulco. One of its top lieutenants was arrested last month.

The military said they confiscated 47 guns, grenades and various ammunition from the home, and seized several cars, including a Mercedes Benz.

Mexico has deployed 45,000 soldiers in the war on the drug cartels. More than 18,000 people have died since December 2006 in drug-related violence.

The Mexican offensive has had far-reaching implications, as the shortage of Mexican drug exports, has driven up illegal drug prices around the world. Police in Vancouver have said the spike in gang violence there is related to the shortage of Mexicans drugs, causing gangs to fight over a shrinking supply.

With files from The Associated Press