One immigration official was killed and another wounded on Thursday evening after a shootout erupted inside a federal-government building in Southern California.

A U.S. Immigration and Customs Enforcement investigator died inside the agency's offices in Long Beach, Calif., after being shot at around 5:30 p.m., the agency said in a statement. A second agent was wounded and transported to a hospital and is in stable condition.

The...