An attacker who fatally knifed six people in a Sydney mall was shot dead by police in the city's beachside suburb of Bondi on Saturday, police said, as hundreds fled the scene.

The assailant was shot by a police officer after he attacked shoppers in the busy Westfield Bondi Junction shopping center, police said in a statement.

Five of the six victims killed were women, while eight people, including a nine-month-old baby, were taken to hospital with stab wounds, New South Wales Police Commissioner Karen Webb told a news conference.