RICHARDSON, Texas - A police officer and another person were fatally shot and the suspected gunman was taken into custody after being barricaded in an apartment in suburban Dallas Wednesday night, authorities said.

CBS DFW reports the standoff lasted about four hours.

Police say the incident began about 7 p.m. Wednesday as the officer was checking on a report of a disturbance at the apartment complex in Richardson, Texas. The officer was taken to a hospital in nearby Plano. About three hours later, Richardson police reported that he had died.

Richardson police spokesman Sgt. Kevin Perlich initially said the condition of the second person who was shot wasn't known. But, shortly after midnight, police said that person had died, The Dallas Morning News reports. That person was a civilian, says CBS DFW.

Perlich told the Morning News that the gunman surrendered after being cornered in an apartment and randomly firing throughout the evening. Witnesses said the suspect shouted "I'm sorry" as he was taken into custody. 

CBS DFW says people in the apartment complex were told to shelter in place as the standoff continued.

The officer who died was 37, and was shot in the neck, the station adds.