A KNIFE attacker killed six people and injured several others in a stabbing spree at a Sydney shopping centre before being shot dead by police.

The lone knifeman attacked shoppers on Saturday afternoon at the Westfield shopping centre in the suburb of Bondi Junction in eastern Sydney.

A female New South Wales Police inspector confronted the attacker and shot him dead as he raised a knife and lunged at her.

Police said they had identified the attacker as a 40-year-old man who was known to them, but added that they do not think he was motivated by terrorism.

Four women and a man died in the shopping centre and another woman later died in hospital, police said.

READ MORE: STV journalists set to go on strike for second time

A nine-month-old infant has undergone surgery and “about eight” people, including the child, are in hospitals around Sydney receiving treatment for “different injuries” as a result of the attack.

Emergency services were called to Westfield Bondi Junction following reports that multiple people had been stabbed at 3.30pm (6.30am UK time), police said.

Anthony Cooke, assistant commissioner of New South Wales Police, said a police officer “confronted the offender”.

At a press conference, he said: “As she continued to walk quickly behind to catch up with him he turned to face her, raised a knife, she discharged a firearm and that person is now deceased.”

He added: “This all happened very, very quickly – the officer that was in the vicinity attended on her own, was guided to the location of the offender by people who were in the centre.

“She took the actions that she did saving a range of people’s lives; (she was) an inspector, a senior police officer – she was on her own. She engaged immediately on her arrival to the scene.”

ABC News Australia spoke to a witness, who did not want to be identified, and reported that the person “saw a bloke in a green shirt start stabbing people indiscriminately”.

Footage emerged of a man with a knife in shorts and a green and yellow shirt being confronted by another man on an escalator.

Another witness at the centre said the attacker was “on a killing spree”.

The shopper, who was not named, told ABC News of the moment he was shot: “He just started floating towards us and all I heard was ‘put it down’ and then she shot him.

“But we were in no doubt, if she didn’t shoot him, he would have kept going. He was on the rampage. Then she walked over and gave him CPR. He had a big blade on him – she chucked the knife away. He looked like he was on a killing spree.”

A man at the shopping centre said he helped the baby who had been stabbed.

The man told 9News Sydney: “The baby got stabbed. The mum got stabbed and came over with a baby and threw it at me – I was holding the baby, it looked pretty bad.

He added: “There was a lot of blood on the floor. I hope the baby is all right.”

Another shopper at the centre near Australia’s Bondi beach said she thought she was “going to die”.

The shopper, who was not named, told ABC News: “I was hiding in the backroom. I was hearing gunshots.

“It’s just the worst thing ever, who does that to people? I thought I was going to die. Every moment was playing through my head, I was so scared.”