An espionage ring that penetrated the prime minister's office and senior positions of the Defense Ministry and passed secrets to foreign agents was broken today with the arrest of at least seven persons, five of them Indian government officials, authorities confirmed tonight.

The seven alleged spies, including a personal assistant to Prime Minister Rajiv Gandhi's principal secretary, were arrested and arraigned before a metropolitan magistrate, who ordered them held by police for 10 days.

Three of the arrested, according to Indian news agencies, had been working in the prime minister's secretariat and had access to sensitive state secrets. Two were said to have worked for the Ministry of Defense. The other two were identified by security sources tonight as businessmen.

Reuter reported early Saturday that one of the most senior advisers to Gandhi has resigned following the seven arrests, according to a member of the adviser's household.

She was quoted as saying that P.C. Alexander, principal secretary to Gandhi, resigned Friday. The Indian Express newspaper reported Saturday that one of the seven arrested men was T.N. Kher, Alexander's personal secretary. There was no indication that Alexander had any role in the alleged spying.

[The United News of India quoted reliable sources as saying the arrested officials included two deputy secretaries and two undersecretaries, Reuter added.]

Several other suspects were reportedly being held in connection with the ring, but no details were available on their identity.

Invoking the National Secrets Act, Indian officials refused tonight to divulge the names of the arrested officials or identify the foreign country to which they are alleged to have reported.

Shadara Prasad, the prime minister's press secretary, said in a telephone interview: "I don't know how many have been arrested, but among them were some people working in the prime minister's secretariat. Several people, I understand, have been produced before the magistrate."

The first hint of an espionage scandal came in a brief statement to Parliament by Gandhi, who on Oct. 31 assumed the leadership of India after the assassination of his mother, Indira Gandhi.

In a statement to both houses of Parliament today, Gandhi said, "Certain employes in sensitive positions" had been arrested on suspicion of indulging in "activities detrimental to the national interest."

Asking legislators not to press him for details, Gandhi said, "While reviewing the security procedures, it came to the government's notice that certain employes in sensitive positions were suspected to be indulging in activities detrimental to the national interest. Some arrests have been made in the course of investigations, which are still proceeding. I am confident that honorable members would not press me to say anything more at this stage, as it might hamper these investigations."

When pressed for details, the prime minister said, "It would not be in the national interest to do so at this stage."

The arrests followed repeated public statements by the prime minister that "foreign forces" were working to destabilize India, although Gandhi has never specified which foreign countries were involved.

The United News of India, quoting special "police sources," said that "the arrested people had been divulging to foreign sources vital information about the prime minister's secretariat and defense."

The agency said that the arrested included two deputy secretaries and two undersecretaries, and that some "incriminating documents" had been recovered. The agency said that three or more suspects still were being sought by security officials.