Orlando police

An Orlando police officer says he was ordered not to pursue gunman Omar Mateen into a women’s restroom after he opened fire in a gay bar.

49 people were killed and 53 others were wounded in the mass shooting at Pulse Nightclub on June 12.

Officer Brandon Cornwell, 25, was among the first group of officers to arrive at the nightclub after the initial round of shooting by the gunman.

Cornwell and the other officers exited their patrol units with assault rifles.

“Some [cops] ran towards the building; some stayed back with people running out,” he said. “There was tons of people running out of the club. I grabbed my assault rifle and ran toward the club. At this point, the shooter is still actively shooting inside.”

Cornwell and the other officers entered the dimly-lit nightclub with assault rifles raised. He said he and the other officers were “trying to locate exactly where the shooter was — we kept hearing people scream and shots fired.”

The officers followed the sounds of gunshots to the women’s bathroom where Mateen was holding hostages.

The officer said he and the other cops were told by a commander to hold their positions after the sounds of gunfire had ceased.

They waited “15 or 20 minutes — could’ve been longer” — until the SWAT team arrived, he said.

“We just basically stayed there, waited for movement, and we just held our position until SWAT got there,” said Cornwell.

Cornwell said he didn’t second-guess his commander, or why first responders were told not to pursue Mateen into the women’s bathroom.

He indicated the officers may have been concerned for their own safety because they weren’t wearing tactical gear.

“Once SWAT got there, they told us to retreat, that they’d take over because we were not really in tactical gear — we were just in our police uniforms,” he said.

About 30 people were rescued from the bathrooms after SWAT shot and killed Mateen 4 hours later.