police officer stands guard amid reports of a shooting in Auckland, New Zealand on July 20, 2023
Six other people, including police officers, were injured and the gunman is also dead after the incident at 07:22 (19:22 GMT) on a construction site in the central business district.
PM Chris Hipkins said the attack was not being seen as an act of terrorism.
The tournament would go ahead as planned, he said.
The public, he added, could be assured police had neutralised the threat and there was no ongoing risk after the incident on Queen Street.
No political or ideological motive for the attack had been identified, the prime minister said.
The gunman, he said, had been armed with a pump-action shotgun.
Mr Hipkins thanked "the brave men and women of the New Zealand police who ran into the gunfire, straight into harm's way, in order to save the lives of others".
"These kinds of situations move fast and the actions of those who risk their lives to save others are nothing short of heroic," he added.
According to Auckland Mayor Wayne Brown, all Fifa personnel and football teams are safe and have been accounted for.
"I can't remember anything like this ever happening in our beautiful city. This morning's events have been tragic and distressing for all Aucklanders, as this is not something that we are used to," Mr Brown said on Twitter.
Fifa expressed its "deepest condolences" to the victims' families and said it was in communication with New Zealand authorities.
"The participating teams in close proximity to this incident are being supported in relation to any impact that may have taken place," it said.
The opening match is to be held between New Zealand and Norway in the city's Eden Park.
Sport Minister Grant Robertson said there would be extra police in the area to provide reassurance.
The ninth Women's World Cup is being co-hosted by New Zealand and Australia.
Earlier, the mayor warned people should stay home and avoid travelling into the city. Mr Brown said it was a "dreadful thing to happen" in his city.
Police say they heard reports of a person discharging a firearm inside the construction site, and the gunman moved through the building and continued to fire.
The man then went into a lift shaft and police attempted to engage with him.
Further shots were fired by the man and he was found dead a short time later, police say.
Following the shooting there was a large armed police presence in the central business district not far from the waterfront and the fan park.
Tatjana Haenni, chief sporting director for National Women's Soccer league USA, is staying close to where the shooting happened.
She told BBC News she had woken up to sounds of police cars arriving and was told to stay inside. "So far we feel safe," she said.
-- Courtesy of BBC News