A gun battle broke out between the militants and security forces after the latter launched a cordon and search operation in Mindora village of Tral, 36 km from here, police said.
"Two militants -- both locals -- were killed in the operation," a police officer said.
He said three security force personnel, including an Army officer and a policeman, sustained injuries during the operation.
The operation was launched after security forces got a tip off that a local Hizbul militant along with another accomplices had come home.
Some arms and ammunition have recovered from the scene of the encounter.