A 32-year-old security guard at the District Building was shot and killed there last night, apparently during an altercation that began when he made advances toward a woman aide in the executive office of the mayor.

The woman, identified as Janet A. Wilson, 38, the mayor's Freedom of Information Act officer, was charged early this morning with homicide in connection with the shooting.

The special police officer, James Harvey Daniels, was killed by a shot from his own gun, apparently wrested from him during the altercation on the first floor of the building, Washington's city hall.

When hit about 6:45 p.m., Daniels was apparently on or near a marble staircase leading up from the first floor entrance corridor. Blood stains were found on nearby walls. After being hit in the chest, Daniels apparently staggered to the building's elevator, where he collapsed about 10 yards or so from his guard post at the 13 1/2 Street NW entrance.

Daniels was taken by fire department ambulance to the George Washington University Hospital. He died in the emergency room at 7:43 p.m.

Few details of the reported altercation were immediately available, but it appeared that three shots were fired. Two spent bullets were recovered in the corridor by searching police who flooded the building after the incident. At least one of the bullets was embedded in a wall.

The security officer, who lived at 4900 East Capitol Street, was on duty at the entrance on the building's east side, in accordance with standard. Saturday evening security procedures at the building. No other entrance was open.

It was not immediately clear when Wilson, whose office is on the building's ground floor, arrived to work yesterday. Few other employes were reported in the building when the incident took place, but at least one other woman was being interviewed as a possible witness.

Mayor Marion Barry arrived at the District Building last night after the shooting, apparently to receive a report on the circumstances. He left after being briefed by police and no comment was released to the press.

Wilson's office is part of the D.C. office of the executive secretary, which is attached to the executive office of the mayor.

According to one police source, Wilson appeared distraught after the incident, and investigators waited for some time before attempting to question her in detail.