COLOMBO, SRI LANKA, JULY 30 (THURSDAY) -- Advance contingents of a 1,600-man Indian peace-keeping force began landing on Sri Lanka's troubled Jaffna Peninsula this morning only hours after Sri Lanka and India signed a wide-ranging accord to end the ethnic strife in which an estimated 6,000 Sri Lankans have died since 1983.

Sri Lankan officials said 36 planes and three ships are expected to bring about a brigade of Indian troops to assist Sri Lankan forces in enforcing a cease-fire, the first element in the accord signed yesterday by President Junius Jayewardene and Indian Prime Minister Rajiv Gandhi.

Yesterday's signing ceremonies took place amid angry demonstrations that left this port capital ringed in smoke from fires at government buildings in several suburban communities. The angry reaction of Sri Lanka's Sinhalese majority underscored the difficulty the two South Asian leaders face in implementing the agreement.

As Gandhi reviewed a Sri Lankan honor guard before departing today, a sailor suddenly swung his rifle butt at Gandhi's head, striking him on the shoulder. Gandhi was hustled to his motorcade and to the airport for his flight to India.

It was not immediately clear who Gandhi's assailant was or why he attacked. {Gandhi appeared shaken but uninjured, news agency reports said.}

The accord stipulates that Sri Lanka may request Indian troops to help enforce the cease-fire. Their rapid arrival indicated the determination of both leaders to press ahead despite the possibility that the Indian military presence could spark even more violent reactions.

The troops provide both practical and symbolic evidence of India's determination to help put down an insurgency by Tamil guerrillas that has left this country in a state of virtual civil war. But they also will be a signal to the guerrillas that India will not allow Sri Lanka to take advantage of their weakness once they turn in their arms, which is to occur within 72 hours after the cease-fire begins.

Gandhi is expected to meet today in New Delhi with the leader of the main guerrilla group, the Liberation Tigers of Tamil Eelam. Gandhi acknowledged yesterday that the group is uneasy about the accord provision calling for a surrender of arms. But, the Indian leader said, "I feel they will come along with us in implementing this agreement."

Fifteen persons were reported killed yesterday in battles with police in Colombo and several other cities, bringing the two-day toll to 33 dead and scores injured, mostly when police opened fire on advancing demonstrators. Army units replaced police in several areas in Colombo yesterday.

The demonstrators come from the Sinhalese population, which believes the agreement signed yesterday by Jayewardene, a Sinhalese, gives too much to the country's minority Tamil population.

Sri Lanka's Sinhalese, mostly Buddhists, believe their culture is constantly threatened from outside, notably by the mostly Hindu Tamils, who share cultural ties with the Tamils of southern India.

Tamils make up about 18 percent of Sri Lanka's 16 million people. They feel they are discriminated against by the Sinhalese. Beginning in the early 1980s, this sentiment boiled over into an active guerrilla movement seeking an independent homeland in the northern and eastern parts of the island.

Sri Lanka has agreed to set up a single provincial council and government for the Northern and Eastern provinces, where most Tamils live, to disband controversial paramilitary units that have been accused of widespread human rights abuses and to pull Army units in the Tamil-dominated northern Jaffna Peninsula back from positions taken in recent fighting.

This would give the Tamils the autonomy they have long sought, although there is a provision for a referendum in the Eastern Province by the end of 1988 on whether it wishes to remain linked to the north. Tamils make up about 40 percent of the population of this province with Moslems and Sinhalese comprising most of the rest.

Although India officially has denied it, New Delhi or the state government in the southern Indian state of Tamil Nadu often has assisted the Tamil guerrillas, according to analysts and diplomats. It is this role that ultimately made India an active participant in yesterday's accord.

Under the agreement, New Delhi pledges to halt any activity on its soil that threatens Sri Lanka and to deport Sri Lankan citizens who engage in terrorist actions against Sri Lanka or use India as a base for separatist activities. India also commits itself to joint patrols with Sri Lanka in the narrow Palk Straits that separate the two countries.

The arrival of Indian troops means they risk fighting Tamils, which is not likely to be popular in southern India. At the same time, their presence on Sri Lankan soil is likely to send up a red flag to Jayewardene's political foes as well as some in his own government who oppose the accord.

At a joint press conference after the accord was signed, Gandhi spoke of an "unusual and great" achievement being reached to "turn swords into plowshares." Speaking of India's responsibilities, the prime minister pledged to follow "scrupulously" the obligations it undertook in the accord.

As Gandhi and Jayewardene spoke in a heavily guarded compound near the Sri Lankan president's residence, smoke from fires lit by demonstrators surrounded this picturesque port city. The entire country was placed under a 24-hour curfew following the violence.

Demonstrators attempted to approach the city from outlying suburbs. In one march, along a seaside road, nervous police opened fire when they were approached by a large crowd led by Buddhist monks, witnesses said.