MANILA, Philippines (AP) _ Nine supporters of Ferdinand E. Marcos were arrested today after authorities found guns hidden in cars they were taking to visit a military leader who helped oust Marcos, Defense Ministry officials said.

Laoag City Mayor Rodolfo Farinas and eight bodyguards were taken into custody Wednesday for questioning in connection with the possession of several automatic rifles and other firearms, said Ministry spokesman Silvestre Afable. He indicated illegal weapons possession charges would be filed later.

The nine were going to pay a ''courtesy call'' on Defense Minister Juan Pone Enrile at Camp Aguinaldo, said another ministry spokesman, Jose Flores. Enrile and Gen. Fidel V. Ramos were the two top military leaders who defected to Corazon Aquino's side on Saturday, helping to hasten Marcos' fall from power Tuesday.

Flores said the nine men, from Marcos' home province of Ilocos Norte, were not authorized to carry firearms and did not say anything about wanting to take arms to the camp to surrender them, as many former Marcos supporters have done.

Mrs. Aquino appealed to her predecessor today to tell his loyalists still in the country not to foment violence against the new government.

The president, interviewed on ABC's ''Good Morning America,'' said, ''Let me ask Mr. Marcos that if he still has any loyalists here who intend to do the Filipinos harm then Mr. Marcos do your very best.

''Think of your countrymen who have already been hurt, who have already suffered so much under your regime,'' she said. ''The time is now to make amends and so whatever you can do to discourage your loyalists from inflicting more harm on our people should be your concern.''

Police said today that two alleged communist rebels were killed in an attack in Bataan province west of Manila on a police official, the first deaths involving Filipino insurgents since Mrs. Aquino became president.

The Philippine Constabulary in Pampanga said two men riding a motorcycle Wednesday followed a jeep carrying Col. Jose Andaya, the provincial police commander. When one fired a pistol, both were killed by return fire, police said.

Also today, Mrs. Aquino began releasing Filipinos jailed on political charges under Marcos. A military leader said another 400 could be freed soon.

Emotional reunions with friends and relatives occurred as at least a dozen people were taken out of detention at two camps in Manila, including poet Milagros Aguilar, 35, jailed since 1984 for ''rebellion and subversion.''

At an outdoor Mass in Manila, one ex-prisoner, identified as Jaime Verdan, told hundreds of worshipers, ''I cannot say how happy I am. I thank 'people's power' and God.''

Special U.S. envoy Philip Habib arrived in Manila today and met with Mrs. Aquino to congratulate her on her victory, said a statement from Mrs. Aquino's office.

Habib said, ''Filipinos had astonished the world with their courage,'' and ''pictures of nuns kneeling in the path of on-rushing tanks had deeply moved the American people and those in the highest circles of the U.S. government,'' according to the statement.

Habib was in the Philippines last week on what was officially called a ''fact-finding mission,'' before the collapse of the 20-year-old Marcos government and the former ruler's flight to Hawaii via Guam.

Spokesmen for Mrs. Aquino said she also met privately with envoys of the 12-nation Common Market and with ambassadors presenting letters from their governments, many of which had refused to recognize Marcos' victory in the Feb. 7 election that Mrs. Aquino said Marcos had stolen from her by fraud and violence.

Others prisoners being readied for release at Bicutan and Fort Bonifacio included Dr. Nemesio Prudente, a former university president accused of having communist ties; the Rev. Edicio Dela Torre, a Roman Catholic priest; ex- government official Horacio Morales, who was suspected of leading the allegedly subversive left-wing National Democratic Front, and Romeo Castello, a trade unionist accused of subversion.

Rene Saguisag, a civil rights lawyer who is Mrs. Aquino's official spokesman, told reporters that the prisoner releases were being handled on ''a case-to-case basis.''

Ramos, the new military chief, said after the Mass at Camp Crame, headquarters of the pro-Aquino ''people's power'' revolt that drove Marcos into exile, that 33 people jailed on political charges were slated for immediate release.

Ramos said a Defense Ministry task force was ''processing as expeditiously as possible'' papers for the release of at least 400 more people in military custody.

The head of the Philippine human rights organization Kapatid, or Brother, said the group had given Mrs. Aquino's government a list of 560 detainees, most of whom were jailed under Marcos' Presidential Detention Act.

The act, set up as part of Marcos' 1972 decree of martial law, provided imprisonment for activities that threatened national security or public order.

Mrs. Aquino's husband, opposition leader Benigno Aquino, was jailed for seven years under martial law. Freed in 1980, he left for voluntary exile in the United States and was assassinated in 1983 as he returned to Manila to challenge Marcos.