The authorities evacuated the pilgrims to Pahalgam immediately after the attack, which left nine dead and 32 injured, but later allowed them to continue, said J&K administration officials.
One of the militants was killed by security forces, who continued their search in the nearby hillock around Nunwan base camps for the rest, said the officials.
Those returning after visiting the 3,880 metre high cave shrine, started arriving in Pahalgam, after a brief stop at Chandanwari in view of the attack, they added.
Jammu and Kashmir Governor G C Saxena, Chief Minister Farooq Abdullah, Minister of State for Home Khalid Najeeb Suharwardhy, Director General of Police A K Suri and other senior officials visited Pahalgam to take stock of the situation.
BJP condemns attack on pilgrims, says time for 'stern action'
Tell us what you think of this report