TAMPA — As members of the SWAT team stood ready outside his house and a negotiator implored him to come out with his hands up, Adam Mayo aimed an iPhone at his bathroom mirror and sent a profanity-laced message to the world.

"The police came here to Baker Act me and they've got a …BearCat military vehicle in the … driveway," Mayo said, wheezing and gagging from gas canisters Tampa police shot into his bungalow on Jean Street. "I busted off two shots as they started breaking in out of instinctual reactions. I hope my two … bullets didn't … hit nobody."

For more than three hours Monday, the 30-year-old kept police at bay, refusing much of the time to pick up the phone to talk with a negotiator. But as the standoff unfolded, Mayo broadcast live on Facebook nine times, offering a running commentary to a handful of Facebook friends who grew increasingly alarmed as they watched the drama escalate.

But they weren't the only ones watching. Police were, too.

• • •

Judy Mayo was worried. Her son has a mental health disorder that has resulted in him being hospitalized under the state's Baker Act numerous times. The law allows law enforcement to take someone for a mental health evaluation if they appear to be a danger to themselves or others.

"When he's taking his medicine, he's kind, decent, intelligent and loving," Judy Mayo said. But he starts to believe he doesn't need the medication, she said, and stops taking it.

Last week, she told police that Adam had sent her several photos of a gun and was making troubling statements. She got a court order to have him taken into custody.

When officers arrived about 3:40 p.m. Monday, Mayo refused to come out.

His Facebook broadcast started just after 4.

As a Tampa police officer walks in the street, Mayo pulls back a curtain in the darkened living room and shines a green laser point at the officer, who can be seen speaking into a radio on his shoulder.

"Yeah, you better call for backup!" he shouts over the barking of his three dogs.

"They seriously don't get it," Mayo tells the camera. "They say you have to go talk to a doctor about medication."

At that point he zooms in on a container of cannabidiol, a chemical in the cannabis plant that is used for therapeutic purposes but does not make users feel stoned.

Throughout the standoff, Mayo insists that CBD, not pharmaceutical drugs prescribed by psychiatrists, is the only medicine he needs.

"We just need you to come out, Adam," a police negotiator says again and again. "No one wants to hurt you."

At one point, Mayo uses the barrel of a black handgun to part a curtain.

"Miss, you got a body bag ready? I know you got your guns drawn! I'm going to start shooting if you don't leave!

"You're not taking me nowhere! I'm not willing to shoot an officer unless you try to come take me!"

• • •

The Internet has played a role in standoff situations for years.

In 2012, for example, a Baltimore blogger wanted on a warrant refused to come out of his home for hours, broadcasting his discussion with a police negotiator live on the Internet before turning himself in peacefully.

In 2014, UFC fighter Jason "Mayhem" Miller live-tweeted a standoff when police came to his home to arrest him on outstanding warrants.

But with the advent of streaming video applications such as Periscope and Facebook Live, observers can get a firsthand view of events as they happen.

Tampa police Lt. Rich Mills, commander for the department's SWAT Team, said officers by now are used to being filmed as they go about their work. But Mills could remember only one instance in which a barricaded subject has streamed the incident live.

In Mayo's case, officers found out within about 90 minutes that he was live on Facebook because Mayo told them so more than once.

The broadcasts offered a tactical advantage, showing officers where in the house Mayo was and what kind of weapon he had, Mills said. His running narration also gave negotiators a sense of his state of mind and agitation level.

"We never let him know we were watching because we didn't want him to shut it down," Mills said.

As the standoff dragged on, Mayo made a direct request to his viewers.

"I know there's 10 people watching this, so call 911 and say, officer, what … is wrong with you? Why are you harassing someone I went to school with, someone I've known for 10 years?"

If observers had begun to egg on Mayo and encouraged him to try to hurt police, the department could have gotten a court order to shut down his phone service, Mills said.

Instead, his Facebook friends urged him to end the standoff peacefully.

"Adam man please this isn't worth it please make good choices," one person posted.

"Bro we understand what your saying but there are better ways of going about it.. it's not worth it homey," commented another.

Mayo clicked the "like" button.

• • •

The iPhone picks up the sound of breaking glass. Mayo screams. There's a gunshot.

Police had fired tear gas canisters through the windows.

"Okay, I'm surrendering! I'm surrendering! Can you relax?"

More gas canisters break through the windows. Mayo screams again and retreats to the bathroom.

"Stop, please, please! I told you I put the gun down! I got pets in here, you … bastards!"

Then, he looks into the camera.

"Listen, man, y'all need to relax out there! You broke my window, and I pulled the trigger, didn't I? I don't want to shoot nobody."

Several more minutes pass, and officers shoot more gas.

In the last video, Mayo is talking with the negotiator. His demeanor has changed.

"Can you guys apologize and we'll be on good terms and I'll come out and you can just handcuff me and calm down?" he asks.

He opens the front door and points the camera toward the end of the driveway, where at least a half dozen SWAT members stand behind the BearCat, guns aimed at him.

"On your knees! Put your hands on your head!"

The camera points to the ground as Mayo complies and the video ends.

After officers cuffed him and put him in the back of a patrol car, Tampa Mayor Bob Buckhorn, who spent hours at the scene and watched some of the live video feed, walked up and the men exchanged words. Mayo apologized to the mayor, Mills said.

Mayo was taken to a Tampa mental health facility for evaluation. He has not been criminally charged because there was no evidence he fired at the officers, Mills said.

He said the incident unfolded and ended like a "textbook" standoff should. Now that textbook includes checking someone's social media accounts for live video.

"As technology advances and people get familiar with it," Miller said, "I don't doubt that we'll see more of it."

Times news researchers Caryn Baird and John Martin contributed to this report. Contact Tony Marrero at (813) 226-3374. Follow @tmarrerotimes.