At least two other people including another police officer were wounded and taken to hospital, Mayor Mary-Ann Baldwin told a news conference on Thursday.
"We must do more. We must stop this mindless violence in America. We must address gun violence," Baldwin said, without providing many details about the shooting spree.
The shooting broke out just after 5pm on Thursday at or near the Neuse River Greenway, a trail that runs through part of the city.
About three hours later police had a suspect "contained in a residence" but not yet in custody, Baldwin said.
Raleigh police later said on Twitter that, "The suspect has been taken into custody."
The suspect was thought to be a white teenage male with a long gun, WTVD television reported.
Helicopter video from WRAL television showed more than a dozen emergency vehicles lined up on a road through a wooded area, one of multiple crime scenes.
Numerous state and local law-enforcement agencies were involved in the "active investigation," Baldwin said.Â