A man who was holding hostages inside a California office building for about 12 hours was shot and killed by the FBI early Wednesday, police said.