Counter-terror officers are investigating after a man was charged with attempted murder for an alleged attack on three police officers in Sydney that happened in "a flash".

WARNING: Readers may find graphic images below to be confronting.

Frederick Elrezz, a 32-year-old Lakemba man, faces a number of charges after his arrest over the incident in the CBD on Tuesday night.

The officers were responding to a report of harassment directed at a delivery rider just after midnight.

A senior constable was allegedly stabbed in the head during an arrest in Sydney's CBD overnight.

Police allege that when they approached the Lakemba man, he pulled out a knife and attacked.

"It happened so quick it wasn't funny," Assistant Commissioner Mick Willing said.

A 40-year-old senior constable was treated for a laceration on the left side of his head, and a second wound to his left arm.

A 39-year-old acting sergeant was wounded on his finger and knee, and a 20-year-old probationary constable was bitten on his arm.

"He attacked in very, very quick succession," police said yesterday.

"The officers are very, very lucky."

Police claim the man had been staying in backpacker accommodation for the past 10 days.

Detectives are still investigating the motive over the alleged attack, with counter-terror officers brought in to assist.

A witness who supposedly saw the confrontation between the Lakemba man and the delivery rider is being urged to come forward.

NSW Police said overnight he had been charged with cause wounding/grievous bodily harm to person with intent to murder, wound person with intent to resist/prevent arrest, assault police officer in execution of duty, cause actual bodily harm, and resist or hinder police officer in the execution of duty.

He has been refused bail to appear at Central Local Court today.

A probationary constable was allegedly bitten on the arm during an arrest.

Source: 9News