Gunmen sprayed bullets on a passenger bus bringing Hindu pilgrims back from a cave shrine in Indian-controlled Kashmir on Monday, killing at least seven of them, including five women, and wounding 14 others, police said.

A police officer said the bus was carrying more than 50 people on the annual pilgrimage. He blamed the attack on Muslim militants who are fighting against Indian rule in Kashmir. No one immediately claimed responsibility for the attack.

The shooting happened near the southern Anantnag town on the main highway linking the Indian-controlled Kashmir with the rest of the country.

The police officer spoke on condition of anonymity as he was not authorized to talk to reporters.

The pilgrims were returning after paying obeisance at the shrine nestled in the Himalayas at a height of 4,115 meters (13,500 feet) when the attack occurred.

The shooting came despite deployment of thousands of Indian army and paramilitary soldiers on the pilgrimage route.

The militants first attacked a police armored vehicle, and the officers in the vehicle returned fire, a police statement said.

"Thereafter, the militants again fired at a police patrol in which a passenger bus was hit by bullets," the statement said.

The injured have been moved to a hospital, and they were in stable condition, the police said.

India's Prime Minister Narendra Modi condemned the attack and tweeted that "India will never get bogged down by such cowardly attacks and the evil designs of hate."

He also said his thoughts were with the injured and all those who lost loved ones in the attack.

Three top separatist leaders, who challenge India's sovereignty over Kashmir, strongly condemned the attack and expressed "deep sorrow and grief over the killings."

"This incident goes against the very grain of Kashmiri ethos," Syed Ali Geelani, Mirwaiz Umar Farooq and Mohammed Yasin Malik said in a joint statement in Srinagar, the main city of the Indian portion of Kashmir.

The cave is covered with snow most times of the year except for a short period in summer when it is open for the pilgrims. The Amarnath cave houses an ice stalagmite worshipped by Hindus as a symbol of Shiva, the Hindu god of destruction.

Tens of thousands of Hindus take part in the annual pilgrimage which lasts up to one and a half months.

Muslim rebels fighting for decades against Indian rule in Kashmir accuse Hindu-majority India of using the pilgrimage as a political statement to bolster its claim on the disputed Himalayan region.

In the past, the pilgrimage has been targeted by the rebels who have been fighting for Kashmir's independence from India or its merger with neighboring Pakistan since 1989.

The Press Trust of India news agency said the last major attack on the pilgrims occurred in August 2000 when gunmen struck in the Pahalgam area and killed 30 people, including some local porters who carry the baggage of pilgrims on the mountain path.

India accuses Pakistan of arming and training the insurgents, a charge Islamabad denies. Kashmir is divided between India and Pakistan by a cease-fire line, and the two countries have fought two wars over its control since they won independence from British colonialists in 1947. Both claim Kashmir in entirety.