Prime Minister Indira Gandhi was shot to death by her own security detail, last night outside her residence, the United News of India reported.

Gandhi was rushed to the All-India Institute of Medical Sciences, the country's most prestigious hospital, where she died of her wounds.

Sources at the hospital told the Indian news agency that she was shot in the heart and that four bullets lodged in her abdomen. The agency said that according to one report, she had 16 bullet wounds, but this was not confirmed.

The news agency said she was shot by two members of her own security detail and that the two were killed on the spot by other security guards. Without elaborating, the agency also said an officer of the security police was injured and "overpowered."

Several hours after the shooting, an unidentified caller told The Associated Press, "We have taken our revenge, long live the Sikh religion."

Ranku Roy, of The Washington Post New Delhi office reported by telephone that hospital sources said Gandhi died shortly after 11 a.m. Indian time. Roy said doctors removed seven bullets.

[Earlier, thousands gathered outside the hospital, a five-minute drive from the site of the shooting. "Everyone leaving the hospital was very grim-faced and rumors repeatedly swept the crowd that Gandhi had died," Roy said.]

The 66-year-old prime minister came out of her house at about 9:20 a.m. to make a video recording when "suddenly, out of the blue, two persons carrying [submachine] guns -- one uniformed and one in civilian clothes -- shot at Mrs. Gandhi," the Indian news agency said.

"Eight to 10 bullets from the gun hit her. The two persons, stated to be on security duty at the prime ministers' residence, were instantly shot dead," the agency said. Gandhi fell down with a cry, it added, and members of the household and other security personnel rushed to the spot. She was immediately taken to the hospital.

One of the guards allegedly involved in the shooting was identified as Satwant Singh. Singh, which means "lion" in Punjabi, is part of the name of virtually every Sikh. Singh was reported to be injured.

The prime minister had been under heavy security in recent weeks because of assassination threats, reportedly from Sikh extremists. She had returned to New Delhi last night from a two-day election campaign tour in eastern Orissa state.

The premier's son, Rajiv, who is general secretary of the governing Congress I Party, rushed back to New Delhi after hearing the news that she was shot. He was addressing a public meeting in the western state of West Bengal.

Under India's parliamentary system, it was expected that Rajiv will be sworn in as her successor.

Neither police nor the prime minister's office would make official statements on the attack.

Police cordoned off her residence and the hospital, three miles away, where she was taken. Her residence, No. 1 Safdarjang Rd., is on a tree-lined street in central New Delhi.

Gandhi, who would have turned 67 on Nov. 19, was elected to the office of prime minister four times, the last time in 1980. She was the daughter of Jawaharlal Nehru, who led the nation as prime minister for 17 years after its independence from Britain in 1947.

She became prime minister in 1966 following the death of Lal Bahadur Shastri. She was first elected to the office in 1967 and reelected in 1971 and 1972.

In 1975, responding to demands that she resign after a high court ruled that she had illegally used the services of government officials in her 1971 election campaign, she declared a national emergency.

Thousands of Gandhi opponents were jailed, civil rights were curtailed and rigid censorship clamped on the press. During the next 21 months, her regime tightened powers of preventive detention, forced many people to undergo sterilization and rewrote the Indian constitution to make all her actions legal.

In 1977, she called for elections and was defeated by an old rival, Morarji Desai. But she returned to power with a sweeping election victory in 1980.

Gandhi recently was highly criticized by leaders of India's Sikh minority for her government's handling of violence in Punjab, a northern Indian state. Indian Army troops in June besieged and then assaulted the Golden Temple, the Sikhs' holiest place of worship, in Amritsar.

The Gandhi government said the siege was necessary to root out Sikh extremists who were waging a terrorist campaign to gain more control for the Sikhs, a breakaway Hindu sect.

The government said about 492 Sikhs and 93 Army soldiers were killed in the assault; military and police sources put the death toll at about 1,000 Sikhs and 220 soldiers.

After her re-election in 1980, Gandhi leaned more and more on her youngest son, Sanjay, for advice. She was shaken and withdrawn for months after his death in June 1980 in the crash of a stunt plane.

In 1981, her first-born son, Rajiv, yielded to mounting pressure, resigned his job as an Indian Airlines pilot and become a Congress Party member in parliament.

Inside the hospital grounds, the top government leaders and opposition leaders gathered as a neurosurgeon, four surgeons and Gandhi's personal physician accompanied her into emergency surgery.

The Washington Post's New Dehli Bureau reported that first news of the assassination attempt was carried on news wire about an hour after the shooting, but that the information was not broadcast immediately over radio stations.

Accompanied by her physician, Gandhi was bundled into her official car and taken to the hospital, about seven minutes away. She arrived at the hospital about 9:45 a.m. (11:15 p.m. EST), Roy reported.

[In Washington, a White House spokesman said that President Reagan was notified at 3 a.m. of Gandhi's death and that he expressed "deep personal sorrow." ]Deepak Vohra, press attache of the Indian Embassy said: "We are shocked at this incident."

["The attackers were all members of the prime minister's security force, a unit of the police."]

Gandhi said in a recent interview earlier this month that she did not fear assassination attempts.

"No, I'm not afraid -- as you can see, I usually ride in an open car," she said. "I am frequently attacked, she said. "Once a man poked a gun at me, another time in Delhi someone threw a knife at me. And then of course there are always the stones, the bricks, the bottles -- especially at election time."