An F.B.I. agent shot and killed an off-duty New York City firefighter yesterday morning after the firefighter apparently threatened another F.B.I. agent with an AK-47 assault rifle, the authorities said. 
The firefighter, Steven Lopez, 38 years old, of 167 Holden Boulevard in Willowbrook, Staten Island, was pronounced dead at the scene. The shooting took place at 7:28 A.M. in a parking lot adjacent to a marina at Victory Boulevard and Murray Hulbert Avenue in Tompkinsville, Staten Island, a police spokesman, Sgt. Peter Berry, said. 
The F.B.I. agents were preparing to join a scuba diving outing that was apparently to include Mr. Lopez as well, the police said. 
Joseph A. Valiquette, a spokesman for the Federal Bureau of Investigation, said two agents, Thomas J. Pierce and John R. Dew, had gone to the small marina at the Bay Street Landing to give scuba diving lessons to another agent, Richard A. Tait. 
Agents Pierce and Dew, both of whom are experienced divers, apparently were planning to join a larger group that was going to take a chartered boat, the Jackpot, into the choppy waters of New York Harbor. Agent Pierce was off duty and the other two agents were on duty, Mr. Valiquette said. 'Holding an AK-47' 
When Mr. Lopez and Agent Pierce, who knew each other from previous dives, met by their parked cars, they had a brief discussion, Mr. Valiquette said. It was unclear whether they argued, he added. 
As Agent Pierce turned and walked away, Mr. Valiquette said, Mr. Lopez began a conversation with Agent Dew, who had just pulled up in his car. 
Agent Pierce then ''turned around and saw Dew and Lopez in a struggle, with Lopez holding an AK-47,'' Mr. Valiquette said. 
''Pierce heard the AK-47 being fired and reached for his weapon,'' Mr. Valiquette said. ''But before he could draw his weapon, the third agent, Tait, drew his weapon. He yelled at Lopez that he was the police and he should drop his weapon. Tait then fired two rounds, killing Lopez.'' Ammunition and Shotgun 
Mr. Lopez was hit twice in the chest, Mr. Valiquette said. 
The police recovered the AK-47 as well as two curved ''banana clips'' full of ammunition and a shotgun that were found in Mr. Lopez's car, Sergeant Berry said. It was not clear if the weapons had been legally registered, a police spokesman said last night. 
No one has been charged in the shooting, the police said. All three agents remain on active duty and the incident is being reviewed by the F.B.I., Mr. Valiquette said. 
Mr. Lopez, a firefighter first grade, joined the Fire Department in January 1974 and most recently was assigned to Engine Company 245 in the Coney Island section of Brooklyn, said Efrain Parrilla, a spokesman for the department. Mr. Parrilla said two brothers of Mr. Lopez are also city firefighters but he declined to identify them. Shouts of 'Help Me!' 
A flag in front of the fire station, at 2929 West Eighth Street, was at half-staff yesterday. A spokesman for the company, Lieut. Sal Brillante, said he and his colleagues had been asked by officials not to talk about Mr. Lopez to reporters because of an investigation. 
Several people who live at 10 Bay Street Landing, a large apartment building near the scene of the shooting, said they had seen or heard the incident. Peter Sutter, who lives on the first and second floors of the building, said he awoke to the sound of a man yelling ''Help me!'' three times, followed by three ''popping sounds.'' 
Joseph Tizzuto, captain of a fishing boat that shares a dock with the Jackpot, said he saw ''two guys hassling with a rifle.'' 
''Then the rifle went off and I hit the ground,'' he said. ''Then I heard two more shots. When I got up, the guy who was holding the rifle was down.'' 
Photo of marina at Victory Boulevard (NYT/Dith Pran)