So what exactly happened Tuesday night when gunmen — one of them using what is believed to have been an assault rifle — shot two Chicago Police tactical officers in Back of the Yards?

Sneed is told the two officers — one of them the son of a deputy police chief — likely were mistaken as Almighty Saints gang members and targeted by rival La Raza gang members before being ambushed.

“The injured tactical officers were gunned down approximately three hours after another gang-related shooting [that] they had been investigating occurred,” said a police source familiar with the matter.

Here’s the tick-tock of what happened, according to the source:

• Around 6:30 p.m. Tuesday, three young men in a black Nissan “called 911 to report one of them had been shot. . . . The tactical officers noted the men in the black Nissan were wearing La Raza gang tattoos.”

• Several officers responded to the scene and were told the three in the Nissan had been “driving on South Halsted at 18th Street when two male Hispanics in black hoodies ran up to them and one of them starts shooting at them inside the car.”

OPINION

The shooters hit the Nissan “multiple times. . . . The people in the car then sped off and drove from there to Archer and Halsted, where they called 911.”

• A Chicago Fire Department ambulance rushed the shooting victim — a teenager — to Stroger Hospital as officers began interviewing the other two people who were in the Nissan. During the investigation, the cops recovered bullets as evidence.

• As the investigation unfolded, the cops got word that the bullet removed from the shooting victim was of a different make than the bullets recovered from the Nissan. The wound also appeared to be “self-inflicted,” leading police to believe that the injured man tried to return fire and had mistakenly shot himself.

• There was no weapon recovered from the Nissan, though — leading police to believe the three men had ditched it somewhere before calling them. So police hatched a plan: After letting the La Raza gang members go, the two tactical officers would “follow them in an unmarked, covert car to see where they may have ditched the gun.”

• That didn’t end up happening. The Nissan went to a residence, and police decided to call off the surveillance.

“It was following that surveillance — when the officers were heading back to the their police district after not being led to the gun — that a Chrysler minivan going at a high rate of speed pulled up behind them and the shooting began with what appeared to be assault weapons.”

• Police are now working under the theory that the La Raza gang members thought members of the rival Almighty Saints gang were tailing them — and notified fellow gang members.

To support that theory, “At 9 p.m., while police units were blocking off cross streets to enable help to get to the wounded officers at the scene near 43rd and Ashland, they [the wounded officers] spotted the black Nissan car and its occupants.”

Three “persons of interest” were being questioned, and the shooting remains under investigation.

“It certainly is a possibility that the officers had been mistaken as members of a rival gang,” Chicago Police spokesman Anthony Guglielmi told Sneed on Friday. “But is it also possible officers were targeted because they were officers? We won’t know yet until we interview the suspected shooter. We have put protective details on their [the officers’] homes.”

The officers have been dubbed the “miracle” cops because their bulletproof vests protected them from the hail of gunfire. They were released from the hospital on Wednesday, one day after being shot.

Stay tuned.