In the seedy, Beau Geste-like fortress that headquarters the Salvadoran Treasury Police, Lt. Col. Jesus Casares, the security force's second-in-command, had assembled his troops in a courtyard for an unusual ceremony.

As his rough, combat-dressed troops stood at attention, a quaking private who had been caught drunk on the job that morning was brought before them and fired from the force -- whose lax discipline in the past was notorious. "If it is our responsibility to see that people respect the law," the muscular, tall Casares told his troops, "then we must be models of observing the laws ourselves."

The statement had a novel ring here. El Salvador's three separate security forces have often been a law unto themselves, with the Treasury Police especially accused of close links to right-wing death squads.

Casares' disciplinary action was not an isolated example, but part of a major campaign to restructure the nation's 11,000-member security forces. Col. Carlos Lopez Nuila, the new vice minister of defense in charge of security affairs, launched it last month.

President Jose Napoleon Duarte selected Lopez Nuila in June to discipline and control the traditionally freewheeling paramilitary security forces. He spent three months making a detailed study that forms the basis of the changes he has begun to implement.

"In the struggle against subversion," states the preamble of the otherwise confidential document, "the security forces have shown themselves more independent and autonomous than the armed forces -- adopting decisions without consulting the superior hierarchy or even disobeying general orders, which has caused serious problems."

In an interview in his office at the Defense Ministry, Lopez Nuila said, "We accept the errors of the past because we want to correct him.

"For the moment, the changes we are trying to make may seem like the television show 'Mission Impossible,' " he said, "but, with the support of the president, we believe we have the capacity to establish a real security corps that not only protects law and order but guarantees the rights of the citizens, and in that way contributes to the democratic process here."

Although Lopez Nuila and other senior officials interviewed did not want to be drawn into specific details about the security forces' past failures, they did not dispute that many of their men, especially in their respective intelligence branches, have been involved in the death squads. The U.S. Embassy has made that charge, as have others.

These death squads are held responsible by local human rights organizations and embassy officials for a large number of the estimated 50,000 people killed here in five years of civil war.

A former commander of the National Police, the most professional of the three security forces, Lopez Nuila has focused the majority of his energies on the secretive Treasury Police. His successor at the National Police, Lt. Col. Rodolfo Revelo, is said to continue the work Lopez Nuila began there.

The former Treasury Police chief, Col. Nicholas Carranza, was replaced as soon as Lopez Nuila took office. An ally, Col. Renaldo Golcher, with Casares as his deputy, took over with orders to reform that force.

Golcher's first order was to dissolve the Treasury Police's 20-member intelligence unit, which evidence indicated was deeply involved with the death squads.

Training courses were set up for the 2,000 regular members to shape them into a more professional force. Under Lopez Nuila's plan, courses in respect for human rights became mandatory.

"We are trying to change the mentality of our people so that they understand that part of their job is getting along with the population," Lt. Col. Casares said after his dismissal of the drunken soldier.

"We want then to be seen by the population as a force that is there to support them, not to be a menace to them," he added.

The most important change in the Treasury Police is yet to come, according to Lopez Nuila. His plan involves a reorganization of all police forces and private guard organizations that is to clarify the ambiguous, overlapping responsibilities of the National Police, Treasury Police and National Guard.

The Treasury Police is to be merged with the Customs police. All other paramilitary organizations, from the guard forces that defend electric companies and banks to the private guards that are hired by individuals or private firms, are to be brought under the control and licensing of the Treasury Police.

According to Salvadoran and U.S. officials, the Treasury Police will removed from nationwide law-and-order duties and restricted to handling border duties and supervising the defense of state property and customs.

The National Police that Lopez Nuila used to command is to be given sole responsibility for urban law and order. The National Guard, still to be reorganized, will have authority in rural areas.

All three forces are to answer to Lopez Nuila as a means of imposing central control.

Well-placed sources indicated that the next target after the Treasury Police overhaul would be the National Guard, which was formed originally to defend big landowners.

Col. Napoleon Montes, the old-guard National Guard commander, is due to retire at the end of the year.

According to well-informed sources, Lopez Nuila will then appoint someone along the lines of Golcher.

"There is much we still have to do," Lopez Nuila said. "But we are going to do everything we can to establish a modern, professional security force here that serves the people rather than threatens them."