A former high-ranking official of the General Services Administration pleaded guilty yesterday to attempted extortion in the placement of a Social Security office in the Boston area.

U.S. Attorney William Weld said Lawrence F. Bretta changed his plea as his trial was about to begin and acknowledged receiving two separate payments of $6,000 from an undercover FBI agent.

U.S. District Court Judge Andrew Caffrey scheduled sentencing for Nov. 20. Bretta, a former mayor of Somerville, Mass., faces up to 20 years in prison.

At the time of the incident, Bretta was with the GSA's Public Building Service, the agency responsible for procuring space for federal offices. When he left the agency in February, Bretta held the No. 2 job in the division.

According to the indictment, Bretta tried between 1981 and 1983 to extort nearly $20,000 from East Bay Development Corp. in connection with office space at Mystic Mall in Chelsea for the Social Security Administration.

According to the indictment, Bretta asked East Bay to calculate the proposed rent for the office space to include a $19,700 "commission" for him, and later agreed to accept $18,000 to be paid in annual installments over the three-year term of the lease.

The lease was awarded in January 1982 and the first $6,000 installment allegedly was paid to Bretta on March 5, 1982. He allegedly received a second $6,000 payment on May 18, 1983.