A gunman opened fire with an automatic weapon at a shopping mall outside Amsterdam on Saturday, leaving at least seven people dead and wounding 15 others, Dutch officials said.

The mayor of Alphen aan den Rijn, Bas Eenhoorn, initially said six had died in the shooting at the Ridderhof mall, including the gunman, but one of the injured people later died to raise the death toll to seven.

"It's too terrible for words, a shock for us all," Eenhoorn said.

The gunman's identity was known and it was "all but certain" he acted alone, District Attorney Kitty Nooy said.

The suburb is less than 25 kilometres southwest of Amsterdam.

A witness identified as Maart Verbeek told state broadcaster NOS the attacker had a machine gun and that he had seen at least five people he believed were killed and numerous more wounded.

"There was a panic in the mall, a lot of people running," said Verbeek, a pet shop owner. "I see the attacker coming, walking, and I go inside the store … and I see him going by with a big machine gun."

Dutch broadcaster NOS cited witnesses as saying the man later shot himself in the head with a second weapon, a pistol.

The gunman was described as being about 25 years old and wearing a leather jacket and camouflage pants.

Queen Beatrix and Prime Minister Mark Rutte issued statements saying they were shocked and sympathize with the victims and their families.

Hours after the shooting, residents continued to gather at the mall, some of whom appeared to be in a daze.

"You hear about this sort of thing happening at American schools and you think that's a long way away," said Rob Kuipers, 50, a project manager. "Now it's happened here in the Netherlands."