A federal immigration agent who shot and injured a colleague in their office Thursday was killed when a third agent drew his weapon and fired, the FBI said.

Several shots were fired about 5:30 p.m. in the Immigration Customs Enforcement office, leaving one man wounded, said Steven Martinez, assistant director in charge of the FBI's Los Angeles office.

"Another agent, working nearby, intervened and fired his weapon to prevent additional rounds being fired at the victim," he said.

The gunman died at the scene and the wounded man was taken to a hospital, where he was in stable condition.

Authorities released no details about what led to the initial shooting or the names of the dead gunman, the victim or the agent who fired the final rounds.

The Los Angeles Times, citing multiple law enforcement sources, said the initial shots were fired by an agent at his supervisor during an unspecified dispute.

There were conflicting early reports about the number of people shot, with local authorities saying two were dead and one wounded, while ICE said one was dead and one wounded.

The shooting happened on the seventh floor of the Glenn M. Anderson Federal Building in downtown Long Beach that houses ICE, the Internal Revenue Service and the U.S. Probation and Parole Office.

The wounded agent is hospitalized in stable condition, said ICE Special Agent in Charge Claude Arnold.

"At times like this words honestly seem inadequate. When something like this happens in our offices, it's incomprehensible, Arnold said.

Along with the FBI, the shooting was being investigated by ICE's Office of Professional Responsibility and Long Beach police.