ALLEN, TEXAS -- A gunman killed eight people and wounded seven others -- three critically -- in a shooting at a Dallas-area mall before being fatally shot by a police officer who happened to be nearby, authorities said Saturday.

Authorities did not immediately provide details about the victims, but witnesses reported seeing children among them. Some said they also saw what appeared to be a police officer and a mall security guard unconscious on the ground.

The shooting was the latest episode of gun violence to strike the country. It sent hundreds of shoppers fleeing in panic.

Dashcam video that circulated online showed a gunman step out of a vehicle outside the mall and immediately start shooting at people on the sidewalk. More than three dozen shots could be heard as the vehicle recording the video drove off.

Maxwell Gum, a 16-year-old shift leader at Wetzel's Pretzels, was on his lunch break when a family with limited English ran into the back of his store, urgently telling him, "Gun! Shoot!" as the sound of gunfire could be heard in the background.

He brought the family into the long delivery corridor that runs behind the mall's stores, hoping it would be a safe place to hide. They found chaos.

"There were probably like 300 people pouring in from all the different doors," Gum said. "People are freaking out, we're hearing screaming."

Allen Fire Chief Jonathan Boyd said seven people including the shooter died at the scene. Nine victims were taken to area hospitals, but two of them died.

Three of the victims were in critical condition Saturday evening, Boyd said, and four were in stable condition.

An Allen Police officer was in the area on an unrelated call when he heard shots at 3:36 p.m., the police department wrote on Facebook.

"The officer engaged the suspect and neutralized the threat. He then called for emergency personnel," the agency wrote in the Facebook post.

Mass killings are happening with staggering frequency in the United States this year: an average of about one a week, according to an analysis of The AP/USA Today data.

The White House said President Biden had been briefed on the shooting and that the administration had offered support to local officials. Republican Texas Gov. Greg Abbott, who has signed laws easing firearms restrictions following past mass shootings, called it an "unspeakable tragedy."

Fontayne Payton, 35, was at H&M when he heard the sound of gunshots through the headphones he was wearing.

"It was so loud, it sounded like it was right outside," Payton said.

People in the store scattered before employees ushered the group into the fitting rooms and then a lockable back room, he said. When they were given the all-clear to leave, Payton saw the store had broken windows and a trail of blood to the door. Discarded sandals and bloodied clothes were laying nearby.

Once outside, Payton saw bodies.

"I pray it wasn't kids, but it looked like kids," he said. The bodies were covered in white towels, slumped over bags on the ground, he said.

"It broke me when I walked out to see that," he said.

Further away, he saw the body of a heavyset man wearing all black. He assumed it was the shooter, Payton said, because unlike the other bodies it had not been covered up.

Tarakram Nunna, 25, and Ramakrishna Mullapudi, 26, said they saw what appeared to be three people lying motionless on the ground, including one who appeared to be a police officer and another who appeared to be a mall security guard.

Another shopper, Sharkie Mouli, 24, said he hid in a Banana Republic store during the shooting. As he left, he saw what appeared to be an unconscious police officer lying next to another unconscious person outside the outlet store.

"I have seen his gun lying right next to him and a guy who is like passing out right next to him," Mouli said.

Stan and Mary Ann Greene were browsing in the Columbia sportswear store when the shooting started.

"We had just gotten in, just a couple minutes earlier, and we just heard a lot of loud popping," Mary Ann Greene told The Associated Press.

Employees immediately rolled down the security gate and brought everyone to the rear of the store until police arrived and escorted them out, the Greenes said.

Eber Romero was at the Under Armour store when a cashier mentioned that there was a shooting.

As he left the store, Romero said, the mall appeared empty, and all the shops had their security gates down. That is when he started seeing broken glass and people who had been shot on the floor.

Video shared on social media showed people running through a parking lot while gunfire could be heard.

More than 30 police cruisers with lights flashing were blocking an entrance to the mall, with multiple ambulances on the scene.

A live aerial broadcast from the news station showed armoured trucks and other law enforcement vehicles stationed outside the sprawling outdoor mall.

Ambulances from several neighbouring cities responded to the scene.

The Dallas office of the U.S. Bureau of Alcohol, Tobacco, Firearms and Explosives also responded.

Allen, a suburb about 25 miles (40 kilometres) north of downtown Dallas, has roughly 105,000 residents.

------

Associated Press writers Gene Johnson in Seattle and Adam Kealoha Causey in Dallas contributed to this report.