Hundreds of agents of Mexico's two principal national police forces who were suspected of involvement in drug trafficking or other corrupt activities have resigned or been dismissed in recent weeks, Mexican officials and other reliable sources said today.

More than 400 agents of the Federal Security Directorate's estimated 2,200 have left since the beginning of March, the sources said. The other force, the Federal Judicial Police, also has lost several hundred agents, the sources said.

The government has declined to comment publicly on how many agents have departed, but Deputy Interior Secretary Jorge Carrillo Olea said today that the police agencies were undergoing "severe adjustments of an internal nature," and added: "The nation's various preventive and judicial bodies are working to clean up and correct longstanding vices."

The reported purge appears to constitute the government's most significant action to combat police corruption following recent revelations that some Mexican policeman had helped to protect narcotics dealers.

Much of the corruption has come to light since a crackdown on the drug trade following the abduction and murder of a U.S. Drug Enforcement Administration agent in February in Guadalajara.

The twin problems of drug trafficking and official corruption pose major challenges to President Miguel de la Madrid, who has made "moral renovation" a centerpiece of his program. A variety of political observers have said corruption is entrenched and will be difficult to eradicate.

The Federal Security Directorate is a plainclothed detective force responsible for political surveillance and other internal-security matters. Known by its initials in Spanish as DFS, it is a branch of the Interior Secretariat.

Sources in the U.S. Drug Enforcement Administration have characterized the DFS as highly corrupt. Three senior DFS officials who recently lost their jobs were identified by an arrested drug kingpin as having been recipients of large bribes for protection, according to official sources and Mexican newspaper reports. The three were top-ranking agents in the northern states of Coahuila, Nuevo Leon and Baja California, where a trade thrives in transporting marijuana and cocaine to the United States.

The changes in the DFS have been made since a new director, Pablo Gonzalez, took charge in early March. The former director, Antonio Zorrilla, resigned to run for Congress from the state of Hidalgo.

Fewer details were available about the changes in the Federal Judicial Police, a branch of the national attorney general's office, but reliable officials and Mexican newspaper reports said that 700 vacancies recently had opened up in the force because of anticorruption measures and normal turnover.

In other moves against police corruption, the government recently announced plans to streamline its law enforcement agencies by abolishing several small forces, including those responsible for policing forests and rivers.

It also intends to issue new identification documents to law enforcement officials after dozens of suspected narcotics traffickers, arrested last month, were found to have police credentials. The documents were not forgeries, in most cases, but had been "purchased" from friendly law enforcement officers.

Official corruption has a long history in Mexico, and academic researchers, lawyers, diplomats and other observers said it has thrived because of several factors:

* Fifty-six years of uninterrupted rule by the Institutional Revolutionary Party has meant that no opposition grouping has ever "thrown the rascals out" except in a handful of cities and towns. Terms of office for senior law enforcement officials normally are six years, just as for the president and Cabinet ministers, and this provides the only institutionalized rotation of power.

"We have an underdeveloped political system to go with our underdeveloped economy. The base stays the same, and only the top guys are ever changed. After a while they are corrupted, too, and the vicious circle begins again," a Mexican lawyer, who asked to remain anonymous, said.

* Reliance on political appointees rather than a professional civil service tends to reinforce some of the weaknesses inherent in a single party's dominance. Officials often owe their allegiance to an individual patron rather than to an ideal of clean, efficient service.

"There do seem to be unwritten rules on permissible corruption . . . in terms of both amounts and methods," political scientists Daniel Levy and Gabriel Szekely wrote in their 1983 book, "Mexico: Paradoxes of Stability and Change."

They added: "Whatever the causes of corruption, the personalistic nature of Mexican politics promotes it, and once corruption pervades a system, it feeds on itself."

* Low levels of education and of pay for the police encourage bribe-taking. The average state policeman, for instance, rarely has more than an elementary school education and often earns the minimum wage of less than $4 per day.

"The root of the police problem is in the lack of education," said Norma Corona, a lawyer and president of an independent watchdog committee on human rights in the northwestern state of Sinaloa, where drug trafficking is widespread.