Former Weather Underground member Kathy Boudin pleaded guilty to murder and robbery today in the 1981 holdup of a Brink's armored car, ending a costly and controversial trial with a surprise plea bargain that carried a sentence of at least 20 years in prison.

In a tense proceeding under heavy security at the Westchester County Courthouse, Boudin for the first time in public expressed remorse for her role in the abortive $1.6 million robbery. A Brink's guard was slain in the holdup attempt and two New York policemen were shot to death during the attempted getaway.

"I feel terrible about the lives that were lost, . . . the tragedies," Boudin said softly as she stood before Judge David S. Ritter with her father, noted civil rights lawyer Leonard Boudin, at her side. "I feel that my own separation from my loved ones since she was jailed 30 months ago has enabled me to understand the pain of all people" involved in the case.

Boudin, 40, who spent 12 years underground after gaining notoriety for radical activities in the 1960s, was a passenger in a getaway van after a Brink's armored car was robbed outside a Rockland County bank in October, 1981, according to court testimony.

She was not armed and did not actively participate in the shootings, but was charged with second-degree murder in the shooting of Brink's guard Peter Paige, a crime that carries a maximum sentence of life imprisonment under New York law. Policemen Edward J. O'Grady Jr. and Waverly Brown also were killed in the getaway attempt.

The crimes--for which three Boudin associates, including her husband, David Gilbert, have been sentenced to 75 years to life each--were described as part of an effort to "expropriate" money to set up a new "Republic of New Afrika" in the southern United States.

The plea bargain was initiated April 12 by Boudin's lawyer, Leonard Weinglass, as the sixth week of jury selection and complicated pretrial hearings proceeded, and the move caught court observers by surprise.

Weinglass said in an interview that Boudin initially sought a sentence of 8 1/2 years for robbery, but District Attorney Kenneth Grivetz insisted that she plead guilty to murder, which carries a minimum sentence of 15 years. Grivetz also insisted that she serve 20 years.

Weinglass, emphasizing that Boudin has never been involved in a crime of violence, described the sentence as "extraordinarily harsh." He said, "Kathy has lived 12 years underground and now faces 20 years in prison. Thirty-two years is a longer commitment to ideals than most people ever make."

Weinglass also said that prosecutors offered Boudin reduced sentences if she would testify against and provide information about radical colleagues, but that she refused.

Grivetz characterized the sentence as "very stern but fair." Under its terms, Boudin's sentence would date from October, 1981, and she would be eligible for parole in October, 2001.

Boudin, wearing a brown skirt, white blouse and brown sweater, read softly from a briefly prepared statement in which she recounted her role in the crime and then said, "I have led a life of commitment to political principles and I believe I can continue my commitment to be true to these principles without engaging in violent acts."

As the proceedings opened, Boudin smiled and waved to her mother, poet Jean Boudin, 71. But later she stood tight-lipped and sighed audibly once during 15 minutes of questioning by Ritter, who told her, "This is a day that has enormous personal significance for you and I want to be sure you understand" the implications of the proposed sentence, which cannot be appealed.

"Based on everything I know about you, I believe this could be a fair and just sentence," said Ritter, a former district attorney.

The earlier trials of her associates were marked by public demonstrations and disruptions. The Boudin trial has been controversial here because of its enormous security costs, estimated at between $1.9 million and $6.6 million.

Rockland County, which must bear the cost, has protested in court that Westchester is spending too much in "building a fortress" of security. Measures have included more than 100 police on overtime, erection of a concrete barrier circling the 18-story modern courthouse and other improvements that were made after the trial was moved here because of pre-trial publicity.

The fifth and final Brink's defendant, Samuel Brown, 43, a former member of the Black Liberation Army who is accused of firing some of the fatal shots, still awaits trial.

Ritter said he will formally impose sentence on Boudin on May 3. On that date, Weinglass said, Boudin will have a more extensive statement about her role in the crime and the political movement that led to it.