(Reuters) - Soldiers killed six militants near the border with Pakistan in Jammu & Kashmir, the army said on Wednesday, in the biggest single-day shootouts in months at the heavily militarized border.

The encounter took place in Kupwara in northern Kashmir late on Tuesday, hours after voters turned out in large numbers for a state election that separatists and militants are opposed to.

One soldier was killed and four wounded in the gun battle that lasted several hours, an army officer said.

India has been worried this year that Pakistan-based militant groups fighting foreign forces in Afghanistan will turn their attention to Kashmir once the pullout is completed there.

Last week militants wearing army uniforms attacked an Indian army base near the border with Pakistan, leaving 10 people dead in the worst militant violence inside the disputed state in more than a year.

Tuesday's bid to breach the fenced border took place even after heavy snow blocked routes in the mountains, the army officer said. "They have used sophisticated equipment to infiltrate through the snow," he said.

Traditionally the infiltration takes place in the summer months because the high mountain passes are closed off in winter.

Tens of thousands of people, weary of decades of strife, have been taking part in the staggered vote that will end later this month. Prime Minister Narendra Modi's party is making an audacious bid to win power in Muslim-majority Kashmir, promising voters the fruits of development like the rest of the country.