MOUNT VERNON, Washington — Surveillance video was played in court Monday in the ongoing trial against Ernesto Rivas, the man accused of shooting Mount Vernon police officer Mike McClaughry in the head in December 2016.

The video showed officer McClaughry and two other officers approaching the house where two gang members were hiding out after a shooting earlier in the day.

McClaughry knocked at the door and moments later crumbled to the ground.

Another officer returned fire as detective Preston Payne and others heroically dragged McClaughry to safety, all the while taking gunfire from inside the house.

"As we were trying to pull him back I remember seeing officer Jones across the street with a rifle," said Payne, choking back tears. "I just remember thinking, 'we're going there,' so that's what we did."

RELATED: Prosecutor: Voicemail links suspect to shooting that blinded Mount Vernon cop

In the middle of it all, Rivas called Mount Vernon Mayor Jill Boudreau, who’d had dealings with him in the past about gang issues in the city.

Rivas’s attorneys have said one of the other gang members in the house actually shot McClaughry, but the mayor testified Rivas all but confessed on the phone.

"I believe he said he was going to die," said Boudreau. "I asked, 'Did you shoot my police officer?' He said that he didn’t know and then he said he was sorry several times."

McClaughry survived the shooting but was left permanently blind.

The jury is expected to hear a profanity-laced phone call later this week between Rivas and a police negotiator. Gunshots can be heard in the background and Rivas asking a negotiator, "Do you think I'm playing?" 

RELATED: Mount Vernon officer Mike McClaughry retires

KING 5 will continue to follow this trial and bring you the latest updates.