MIAMI -

Police released surveillance video showing a robbery suspect take a Walgreens clerk hostage while he demands money from the register, setting off a violent ordeal that ended with police killing him and another man.

In the video from 3:34 a.m. Tuesday, Adrian Montesano walks into the store holding a gun to the back of the manager of the pharmacy. The manager gets away, and Montesano, 27, then grabs Daihana Lupo by the neck and points his gun at her.

Watch: Surveillance video: Walgreens robbery

A security guard witnessed the attempted robbery at 2700 W. Flagler Street, and he and Montesano later exchanged gunfire as the robbery suspect fled.

After Montesano left, he shot a Miami-Dade police officer at a trailer park and stole his patrol car.

"He then put the gun to the officer's temple and began to rob him," said John Rivera, president of the Dade County Police Benevolent Association. "He tried to get his Taser out but was fumbling with it and couldn't get it out. Then, he stole the officer's credit card."

Montesano (left) eventually abandoned the patrol car in Hialeah, according to investigators, and picked up an acquaintance, Corsini Valdes (right), in his family's Volvo. At least one of them shot at officers during a chase, and he and Valdes, 50, were both killed by police afterwards.

"If he's using anything that could cause great bodily harm or death to another, then we can use deadly force," said Rivera.

Two other police officers suffered gunshot wounds. They have since been treated and released.