SRINAGAR, India (AP) _ Indian troops shot and killed 31 demonstrators on Thursday as an estimated 1 million Moslems marched through the streets of Srinagar chanting ''Independence,'' witnesses and hospital sources said.

Hospital sources said at least 100 people were admitted to two hospitals in Srinagar, with 25 or more in serious condition.

Witnesses said troops fired on two separate processions of separatists and sympathizers as they strode toward a prayer ground to join comrades demanding the independence of Moslem-dominated Kashmir from predominantly Hindu India.

The sources and witnesses spoke on condition of anonymity.

In New Delhi, a government spokesman confirmed 18 deaths in the incidents.

''The situation is very bad, very tense. Our head count is 18, but there is confusion,'' said the spokesman, who cannot be identified under standing briefing regulations.

Suspected Moslem separatists assassinated a senior Jammu-Kashmir state government official on Thursday in this center of the separatist campaign, government officials in Srinagar said, speaking on condition of anonymity.

They said Pushker Nath Handoo, assistant director of the state information department, was shot as he was about to get into his car outside his home. Handoo was a Hindu, India's religious majority, but a minority in Kashmir.

Witnesses said about 1 million people took part in a procession to the U.N. Military Observers office in Srinagar, chanting: ''What do we want? Independence 3/8'' and ''We want freedom 3/8''

It was the latest in daily demonstrations in Srinagar this past week to push the secessionist demand.

The army fired on Moslem militants at 2 p.m. in Zakura Nishad crossing, six miles from Srinagar, the summer capital of Jammu-Kashmir, killing 23 people, witnesses and doctors at a hospital said.

They said three hours later, soldiers fired on Moslems in Bemina area, three miles from Srinagar, and at least eight people were killed.

The deaths brought to 145 the number of people killed in the latest round of secessionist violence that flared Jan. 20 following a government crackdown on Moslem militants.

Ghulam Rasool Mir, among those wounded by army gunfire, said at Soora Medical Institute in Srinagar the trouble began when soldiers, passing by the procession in three trucks, snatched a flag held by march leaders and the crowd retaliated by hurling stones.

He said the soldiers first fired in the air, then at the crowd.

Another victim, Abdul Gani Dar, said the procession had grouped in neighboring towns and was marching to the Idgah, or main Moslem prayer ground, in Srinagar to merge with a larger procession.

In New Delhi, the government spokesman said the army fired after a mob attacked a vehicle. ''The firing was more in self-defense, because the mob had become violent,'' he said.

The movement for an independent Kashmir has mostly been led by the area's Moslems, who form about 65 percent of Jammu-Kashmir state's 6 million people.

Kashmir, once a princely state, was divided between India and Pakistan after the two lands were partitioned following the end of British colonial rule in 1947. Srinagar and the surrounding areas of the valley became part of Indian-held Jammu-Kashmir state.

Moslems make up 12 percent of India's 880 million population and Hindus comprise 82 percent. Sikhs, Christians and Buddhists make up the rest.

Kashmiri militants earlier campaigned for union with Pakistan, but now demand independence and the status of a neutral nation.

India has fought two wars with Pakistan over Kashmir.