Police killed three unidentified attackers who had pulled up at the police complex in a stolen white car, automatic weapons blazing, at about 5 am.
Prime Minister Narendra Modi and his top Ministers have not made detailed statements on the attack, which is certain to raise tensions with Pakistan if it is proven to have originated across the border.
Throughout the day, regular bouts of small arms fire echoed across the town of Dinanagar and the paddy fields around it, some 15 km (10 miles) from the international border, witnesses said.
Three policemen and three civilians were also killed, according to the home ministry.
The siege focused on an abandoned building where the attackers holed up. It dragged on because security forces had wanted to capture at least one of the militants alive, a senior government source said.
Police sources added that the attackers entered India from Pakistan two days ago in the troubled state of Jammu and Kashmir, a short distance to the north.
Jitendra Singh, a junior minister in Modi's office, said he did not rule out Pakistan's involvement.
"There have also been earlier reports of Pakistan infiltration and cross-border mischief in this area," said Singh, whose constituency in the Jammu region borders Gurdaspur.
Attacks on security installations by militants dressed as soldiers or police are common in Jammu, but Monday's was the first such assault in Punjab in 13 years, according to data from the South Asia Terrorism Portal, which tracks militant violence.
Nuclear-armed rivals India and Pakistan have fought three wars since both nations gained independence in 1947.
Pakistan has denied any involvement in insurgencies in Punjab and Jammu and Kashmir and Islamabad's foreign office said it was not aware of any reports that the people involved in Monday's attack were Pakistani.
Home Minister Rajnath Singh said he had spoken to the head of India's Border Security Force and "instructed him to step up the vigil" on the border.

Latest News from State News Desk