A woman was extricated from an elevator shaft at her Oxon Hill apartment house last night after being pinned for almost two hours between the elevator cab and the inside of the shaft, Prince George's County fire officials said.

The incident began shortly before 10 p.m. in the Park 16 apartments, a high-rise at 4300 Vermillion Ave. The woman, identified by neighbors as Ollie Gray, in her thirties, remained conscious while rescue personnel used an expansion tool to widen the gap between the cab and the shaft to free her just before midnight.

"I'm just scared," one resident of the building quoted the woman as saying while she sat pinned in the elevator. "I'm scared." Another witness said she heard the woman praying.

County fire department spokesman Tony DeStefano said that when rescuers reached the scene the elevator was between the third and fourth floors. The woman's upper body was inside the elevator cab and her legs were below the floor of the cab, pinned between the front edge of the cab floor and the shaft.

DeStefano said it was not immediately clear early today how the accident had occurred.

Accounts pieced together from residents of the building indicated that the woman entered the elevator on a lower floor of the building and that a malfunction apparently occurred then.

One witness, Tiffany Denney, 15, said she had entered the elevator at the same time.

"We got on the elevator . . . she slipped . . . then the elevator shot on up," Denney said.

Denney and a boy about 10 years old, who was also in the elevator, managed to climb out when the elevator halted just below the fourth floor, according to the witnesses' accounts.

Denney said she had attempted to help free the woman.

"I tried to pull her . . . " Denney said, but " . . . I couldn't help her."

DeStefano said county rescue personnel, who were assisted by rescue personnel from the District, did a "fantastic job" in extricating the woman. The effort included partially disassembling the elevator, he said.

While rescue personnel worked, he said, a medical team sent from Prince George's General Hospital set up "something of a miniature operating room" in the building, to be used if needed.

After being freed, the woman was lifted to the fourth floor, then taken downstairs by another elevator to an ambulance, which took her to Greater Southeast Community Hospital. A hospital official said she was in an operating room early this morning. Her condition could not be learned immediately.

Residents of the building said elevator problems had occurred there in the past, and one of the residents said a repairman had been at the building earlier yesterday.