The vehicle of a district and sessions judge came under attack in Daryal area of Diamer, Gilgit-Baltistan on Sunday.
"Assailants fired at district and sessions judge Malik Inayat's vehicle," police said.
"He and his family members remained unhurt in the attack," the police added.
The sessions judge and his family were headed to the funeral of police official Arif Hussain, who was killed on Saturday in a clash which occurred during a search operation to arrest those involved in attacking schools in the area, when their vehicle was targetted, police further said.
Police have launched a search operation in the area to arrest the attackers.