A police officer was shot and killed in the line of duty at a hospital in North Carolina on Saturday, authorities said.