A man with a fake gun was taken into custody at the Orlando International Airport Tuesday night following a nearly three-hour standoff with police in one of the main terminals, officials said.

Police said the suspect was attempting “suicide by cop,” trying to draw gunfire from authorities by threatening bystanders and the responding officers. No shots were fired, but panicked travelers ran for cover as the suspect brandished the fake weapon in the terminal’s rental car area, officials said.

“Gunman is in custody. Everyone is safe,” the Orlando Police Department tweeted shortly after 10 p.m. local time.

Police identified the suspect as Michael Wayne Pettigrew and said he was a former Marine. The 26-year-old faces one count of aggravated assault with a firearm on a law enforcement officer, police said. He is also being held under a Florida mental health law called the Baker Act, which allows authorities to examine a suspect believed to have a mental illness or pose a threat to himself or others.

It was not immediately clear whether Pettigrew had an attorney.

Hundreds of officers converged on the airport starting at around 7:30 p.m., after receiving reports of a black male holding a gun, according to police.

“The suspect pointed the gun at officers and said ‘shoot me, shoot me!'” the department said. At one point he turned the gun toward police, Chief John Mina told reporters.

After the area was cleared, Mina said, officers tried to get the suspect to surrender peacefully.

“It was contained. There was no rush to try and arrest the suspect and cause a deadly force situation,” Mina said. “They knew he was in some type of mental crisis.”

A crisis negotiator was called in to speak with the man around 9:30 p.m. Police said it was not an “active shooter” situation.

Video posted to Twitter appeared to show part of the confrontation inside the terminal. Several officers can be seen crouching behind walls as a man’s voice shouts from outside of frame. “You’re not going to go to prison, you’re going to go to the hospital,” someone can be heard saying.

Another video from the scene posted to Twitter showed dozens of squad cars parked outside the airport with lights flashing.

Law enforcement cleared the first floor of the airport and shut down the terminal where officers cornered the suspect. Traffic was at a standstill initially but started to pick up again after 9:15 p.m. The airport said entrances were “open but congested.”

Glorializ Colón Plaza, 20, told the Orlando Sentinel that she saw people in the terminal hiding and spotted a man near the rental car area. The man was screaming, she said, and police had surrounded him.

“I couldn’t make out the words, but he was screaming really loud,” Plaza told the Sentinel. “Everyone there told me right before this happened a man said to everyone: ‘You’re going to need mental therapy after this,’ then he pulled out a gun and everyone ran.”

The incident comes nearly six months after an Iraq War veteran was accused of loading a gun in a baggage area at the Fort Lauderdale international airport and killing five people. The suspected gunman, Esteban Santiago, was charged with federal crimes and could face the death penalty. Santiago pleaded not guilty to all 22 charges.

That shooting prompted airports across the country to heighten security and urge vigilance among travelers. It also shed light on a Transportation Security Administration policy that allowed Santiago to legally carry the gun and ammunition in his checked luggage.

More from Morning Mix

To find girl missing 33 years, Fla. police gave her a voice on Twitter. It was eerie.

Analysis | The mug shot is ‘the great equalizer.’ Just look at Tiger Woods.

For two evangelical Christians, Manuel Noriega became the ultimate jailhouse convert