Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The man who murdered 49 people at a Florida nightclub used Google while taking shelter from police in desperate hopes of fixing his jammed assault rifle, authorities said Wednesday.

Nearly three years after Omar Mateen's deadly rampage at Pulse, a gay nightclub in Orlando, Orange-Osceola State Attorney Aramis Ayala cleared all 13 police officers and sheriff's deputies who opened fire that night.

Every officer-involved shooting in Florida must be reviewed by local prosecutors, and Ayala found that all rounds fired by responding police and sheriff's deputies were justified.

And during a 40-minute-long press conference, Ayala and Chief Assistant State Attorney Deborah Barra revealed several new details of what was once America's worst mass killing.

Mateen, 29, was armed with a .223-caliber AR-15-style rifle and 9mm semiautomatic pistol when he walked into Pulse on June 12, 2016. The rifle jammed during the assault, before Mateen took shelter in the restroom for three hours.

While hunkered down, Mateen called 911 five times and used his smartphone for internet research.

"He was also on his phone and he was Googling how to spell the word 'allegiance' and he also tried to research how to unjam his firearm," Barra said. "Again, we know that he was not successful in figuring that out."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

In the hours before carrying out the massacre, Mateen used his phone to make several Google searches, records have previously revealed. He looked up "Disney World" and "downtown Orlando nightclubs," which led him to Pulse and another nightspot, Eve Orlando.

He picked Pulse because Eve had too many police in the neighborhood, a lawyer for Mateen's widow has said.

The rifle jam was a key, fortuitous moment in the attack, Barra said Wednesday.

"We know that his assault rifle jammed because there was a spent shell casing that was jammed in the weapon and it required law enforcement to use a dowel in order to unjam it after they recovered his firearm," Barra said. "That's significant because I believe that actually saved lives."

When police finally busted down a wall and used a flash-bang grenade to disorient Mateen, 10 officers and three deputies descended on the killer, Barra said.

Officers fired 172 shots, striking Mateen seven times, she added.

Mateen had earlier told police he had explosives. So when law enforcement approached Mateen's lifeless body, they spotted what looked like wires on him, and they feared he still might be able to trigger a bomb.

That's when one officer fired one more shot into Mateen's prone body, prosecutors revealed.

"When the officer walks up and, knowing that he had previously talked about bombs being present and he saw wires and whatnot, it only takes that for something terrible to happen," Barra said, pressing her thumb to her fist simulating a detonation. "And so the officer made sure that did not happen."

But it turned out, the wires near Mateen were from an "exit" sign that had fallen on him during the final shootout, authorities said.

"To ensure that he was no longer a threat, one bullet was fired into the shooter and he was no longer a threat," Barra said.

None of the shots fired by responding officers and deputies hit any clubgoers, bystanders or first responders, prosecutors said.

At the time, Mateen's killing spree was the worst mass shooting in U.S. history.

It was eclipsed on Oct. 1, 2017, when Stephen Paddock murdered 58 people at a country music festival in Las Vegas from the 32nd floor of the Mandalay Bay Resort.