MANILA, JAN. 21 -- President Corazon Aquino accepted the resignation of Defense Secretary Rafael Ileto today and immediately appointed armed forces chief Gen. Fidel Ramos to fill the post.

Aquino named a protege of Ramos, vice chief of staff Lt. Gen. Renato de Villa, to head the armed forces.

The changes culminated months of behind-the-scenes disagreement between Ramos and Ileto over the conduct of the war against the communist New People's Army guerrillas. Ileto, a counterinsurgency expert who helped defeat a 1950s communist rebellion in the Philippines, repeatedly had advocated a sweeping military reorganization that would largely shift operational control of armed forces units from the Manila headquarters to the field.

In offering his resignation, Ileto criticized the slow pace of the reorganization, which he considered essential to the government's effort to defeat the guerrillas.

"It has been my distinct impression that the reorganization of the military has not proceeded as I had envisioned," he said. "And I fear that divisive elements and controversial issues within the military, if not checked promptly, will erode whatever gains we have achieved since February 1986," when a civilian-military revolt forced former president Ferdinand Marcos to leave the country.

A senior government source indicated, however, that the desire to replace Ileto was motivated not by dissatisfaction with his performance or by policy differences, but more to make room for Ramos in the defense ministry. Some of Aquino's advisers have urged her for months to replace Ramos, who has become a controversial figure during his nearly two years in the post, and Ramos had expressed interest in becoming defense secretary.

The moves are expected to allow Ramos to speak out more openly and strengthen his political position for a possible bid for the presidency when Aquino's term expires in 1992, diplomats said.

De Villa is expected to take a hard-line approach toward the counterinsurgency, reflecting the tougher stance that Aquino has recently adopted.

Aquino praised Ileto in a nationally televised statement in which she announced the changes. She said she accepted his resignation "with much reluctance."

Responding to Ileto's criticism, Aquino said she shared his concern about the insurgency and professionalism in the military.

"May I assure Gen. Ileto that there is only one vision of the armed forces, and it is that which we share and of which his distinguished career is the best example -- total devotion to honor, duty and country," she said.

Ileto assumed the defense post 14 months ago when Aquino fired defense secretary Juan Ponce Enrile after an unsuccessful coup plot by officers close to him. Ileto quietly presided over a sweeping reorganization of the Defense Department, which has been praised by foreign military analysts.

Ileto expected Ramos to undertake a similar reorganization at the armed forces general headquarters, but the changes have not been extensive, the analysts said.

Ileto told reporters today that Aquino had hinted in recent months that she would like him to resign.

Ramos' defenders have argued that during his tenure as armed forces chief the consensus-building general held the divided armed forces together during the country's turbulent transition from authoritarian rule to democracy. But his critics in the government and the military have accused Ramos of weak and indecisive leadership and of involvement in partisan politics.

His role in the rebellion against Marcos, his break with Enrile when the latter began to criticize Aquino administration policies openly, and his defense of Aquino against coup attempts by forces loyal to Marcos and Enrile have resulted in the perception of Ramos as closely identified with Aquino's government.

Foreign diplomats and military analysts, including some U.S. officials, have for months said Ramos' removal from the top armed forces post was necessary to heal deep rifts in the military, some of which have deepened over the issues of Ramos' leadership.

Although he is Ramos' handpicked successor, de Villa is viewed as more acceptable to some officers who have called for Ramos' removal.

De Villa was described by one foreign military attache as a "gentlemanly sort of guy who works in a low-key way." His leadership style, like that of Ramos, is nonconfrontational and geared toward consensus building.

"De Villa knows what the insurgency is about, its political and military requirements," the military attache said.

The timing of the shakeup can be at least partially attributed to a new constitutional provision that requires military officers to retire at age 56 or after 30 years of service, whichever comes first. That provision will force about 40 senior officers, including three of four major service commanders, to retire in April.

De Villa, who also commands the Philippine Constabulary, would have been forced to retire, but his new appointment will allow him to serve another three years.

De Villa, 53, is a 1957 graduate of the Philippine military academy, and attended postgraduate military training at Fort Bragg, N.C. He served under Ramos with a Philippine contingent in Vietnam in the 1960s.

At the time of the February 1986 revolt against Marcos, spearheaded by Ramos and Enrile, de Villa was the regional commander of government forces in the insurgency-ridden Bicol region southeast of Manila.

De Villa immediately threw his support to the military rebels and, after the successful revolt, was named by Ramos to head the Philippine Constabulary.

In his resignation letter, Ileto said that when he accepted Aquino's offer to head the Defense Department in November 1986, "I felt that the insurgency is a major threat to the country and that it should be dealt with effectively by a well-organized, revitalized armed forces. This is the rationale behind the reorganizational and operational concepts I had repeatedly proposed for the military."

Aquino was lavish in her praise of Ileto, noting that she had appointed him to set the armed forces "in the direction of genuine professionalism. He lived up to my expectations."