Updated

A Maryland police officer was killed Sunday afternoon and two people were in custody after what authorities called an "unprovoked attack."

Prince George's County Police Officer Jacai Colson, 28, was pronounced dead after being taken to Prince George's Hospital Center.

Gunfire erupted at around 4:30 p.m. local time in Landover, a suburb about 10 miles northeast of downtown Washington, D.C. Prince George's County Police Chief Hank Stawinski told a press conference that the initial gunfire prompted several officers to return fire at the alleged shooter, who was wounded but was expected to survive.

"Those officers did not shrink. They bravely advanced and engaged this individual," Stawinski said.

Stawinski said a second man was believed to have been present with the suspected shooter when the shots erupted, but fled and was later arrested.

"It wasn't about anything. This man launched an attack on a police station," Stawinski told WTVR. "Officers weren't in the process of apprehending him or engaging him in any way. They were going about their business on a Sunday afternoon, at their home, when they were attacked."

Immediately after the shooting, police advised residents near the police station to stay inside, and others to avoid the area, because of an "active shooter" situation. They later lifted the "shelter in place" advice in a message on Twitter soon after the second suspect was apprehended.

WTTG reported that Colson was ambushed by the suspect, who walked up and opened fire without warning. Colson was working as an undercover narcotics officer at the time of his death, though Stawinski said that had no relation to his shooting.

Prince George's County State's Attorney Angela Alsobrooks called the shooting an "act of cowardice" and a "horrific act of evil." She promised an aggressive investigation and prosecution of the suspects, whose names were not immediately released.

"This is a crime against this entire community and we will treat it as such," Alsobrooks said. "His life was precious."

Maryland Gov. Larry Hogan said in a statement Sunday night he was "shocked and saddened" over the officer's killing.

"It is my hope that his proud legacy of commitment and passion for law enforcement and serving others will provide some comfort in the difficult days that lie ahead," he said.

The Washington Post reported that one woman near the site grabbed her sleeping, 14-month old baby from his play pen when she heard what she thought might be either firecrackers or gunshots. The woman told the newspaper she looked outside and saw a man dressed in black firing a handgun.

"He fired one shot, and then he started pacing back and forth, then fired another shot," said Lascelles Grant, who then watched police officers pour out of the station. "Just looking outside, I'm like, 'Oh my God, look at all these police officers running out, putting their lives really in danger.'"

The FBI and the Bureau of Alcohol, Tobacco, Firearms and Explosives have begun assisting local police in the investigation, spokesmen for the two federal agencies said. They said the Prince George's County Police remained the lead investigating agency.

Dave Fitz, spokesman for the FBI in Maryland, told the AP that the FBI "reached out and offered support" and sent a couple of special agents to assist. He had no further details.

Click for more from Fox5DC.com.

The Associated Press contributed to this report.