An army captain was killed and another soldier was seriously wounded. Pakistani troops responded to the shelling, and the exchange of fire continued for three hours, the official said.
A military official said Wednesday that the shelling was "unprovoked" and said a second soldier was seriously wounded in the firing.
The accusation is the latest in a series of incidents between the two nuclear rivals in recent weeks, usually touched off by tensions over Kashmir, which is divided between the two nations but claimed in entirety by both. Over the past two weeks they have accused each other of violating a 2003 cease-fire agreement along the Kashmir border.
Pakistani military official said the exchange of fire continued till 2:15 a.m. early Wednesday morning.
The skirmishes began earlier this month when New Delhi alleged that a group of heavily armed Islamist militants and Pakistani soldiers crossed the military line of control in the remote Poonch district of Kashmir and killed five Indian soldiers.
Islamabad denies any role in the incident and instead accuses India of killing two civilians and wounding eight others in what it condemned as "unprovoked" shelling across the disputed border. The Pakistani military says the firing also injured four of its soldiers.