Video from the scene showed a man swinging a knife at two police officers near a burning car before he was shot.

In December 2014, a 17-hour siege in which a gunman took 18 people hostage in a Sydney cafe ended with two hostages dead and the gunman killed by police.

Gotcha! Cops nab the wounded terrorist in Melbourne Friday. TWITTER

Though the erratic gunman demanded that police deliver him an Islamic State flag at the outset of the crisis, there was no evidence he had established contact with the militant group.

However, at a later inquest, the coroner of New South Wales state said the gunman’s actions fell “within the accepted definition of terrorism.”

According to the Herald Sun, Khalif’s 21-year-old brother, Ali Khalif Shire Ali, was arrested in November of 2017 in relation to a foiled terror attack in Melbourne.

Victoria state police Commissioner Graham Ashton said the suspect, who was originally from Somalia, was known to police and the incident was being treated as terrorism.

Truck of terror. This vehicle was loaded with gas canisters set to blow up. THE ASSOCIATED PRESS

“From what we know of that individual we are treating this as a terrorism incident,” Ashton told reporters, adding that the police counterterrorism command was working on the case, as well as homicide detectives.

“He’s known to police mainly in respect to relatives that he has which certainly are persons of interest to us, and he’s someone that accordingly is known to both Victorian police and the Federal intelligence authorities,” he said.