India has stepped up security in Kashmir as it tries to prevent disruption of voting in the region, where a revolt against Indian rule has simmered for a quarter of a century.
The Hindu nationalist party of Prime Minister Narendra Modi hopes to take control of the assembly in the Muslim-majority region for the first time.
A senior Indian army officer in the north of the disputed region said soldiers spotted six gunmen on Tuesday who were believed to have crossed the border.
"We challenged them and they opened fire on army troops leading to a gun battle. Three militants have been shot dead and gun battle is on," the officer said.
Earlier this week a village council head was killed in southern Kashmir, and last week gunmen attacked an Indian army base near the border, killing 10 people.
India and Pakistan have fought two of their three wars since independence in 1947 over Kashmir, which they both claim in full but rule in part.
The phased state polls in Kashmir conclude on Dec. 20.
Modi's presence in the campaign has stirred voters, who have turned up in much higher numbers than in recent elections in the state, largely ignoring calls by separatists to boycott what they see as illegitimate polls.