A video posted to social media captures the terrifying moment an armed police officer comes face to face with the man suspected of driving a van into crowds of pedestrians in Toronto.

The suspect - 25-year-old student Alek Minassian - holds something in his hand, which he points at the officer as if it were a weapon.

He shouts that he has a gun and then says: "Kill me."

"No," comes the response from the officer, "get down."

"Shoot me in the head," the suspect shouts again as he appears to aim at the officer.

Seconds later he is in custody, with handcuffs on his wrists.

The clip, which was captured by a witness and passed to CTV, the Canadian broadcaster, sparked a deluge of praise for the officer's restraint during a moment of high danger, with 10 people lying dead or dying.