Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A gunman opened fire at a St. Louis-area community center Monday evening, killing one person and shooting at a police officer who returned fire and wounded the gunman, police in Maryland Heights said.

Investigators believe the shooting about 8:15 p.m. was carried out by a lone gunman, though a motive is unclear, Maryland Heights Police Chief Bill Carson said at a news conference. The suspect was in custody and at a hospital with gunshot wounds Monday night. His condition was not given.

The victim was identified only as a female.

After a woman came out of the community center to report that shots had been fired, a police officer who was in the parking lot immediately went inside and was fired upon after he entered, Carson said.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"The actions of our police officer were actually very heroic," Carson said. The gunman fired "several shots" at the officer who was not injured in the exchange of gunfire between the two, Carson said.

The shooting was captured on surveillance video, which detectives are reviewing, Carson said.

The gunman's identity was not released Monday night.

Families and children were inside the community center, and the shooting sent people fleeing or into hiding, according to reports.

The community center houses the city’s parks and recreation department and also has a gym and a pool.

A woman told NBC affiliate KSDK of St. Louis that she was in the gym when the shooting happened and ran to hide in a closet along with others.

Maryland Heights is a city of around 27,400 in St. Louis County, around 15 miles northwest of downtown St. Louis.

"We heard about five to six shots go off and we all started running toward the closest fitness room," a witness told local CBS affiliate KMOV of St. Louis.