Authorities in South Florida said a man who opened fire early Friday morning in the lobby of Trump National Doral Miami resort in Doral, Florida, was “yelling” about President Donald Trump before he was shot and wounded by police officers.

Police said it appeared that the gunman – who they identified as Jonathan Oddi, 42, of Doral – began shooting at the resort in order to lure officers there so he could ambush them.

“It appears he was trying to engage our police officers [in] some type of ambush-type of attack, trying to lure our police officers … into this gunfight,” Juan J. Perez, director of Miami-Dade police, told reporters at a briefing. “He did succeed, and he did lose, and that’s the bottom line.”

Perez said the gunman pulled the fire alarm, adding that this fueled his belief that Oddi was seeking to shoot law enforcement officers. When police from Doral and Miami-Dade responded, they engaged in a shootout with Oddi, who was shot in his legs by officers, Perez said. Oddi was taken to an area hospital in stable condition, he said.

No guests or employees were injured, and one officer suffered a broken wrist during the encounter, authorities said.

Perez cautioned that it was early in the investigation, and he said police did not know what the gunman’s “long term intentions” were and what else he could have done. But he said the prompt response by officers appeared to avert a more deadly attack.

“If not for the heroic efforts of the police officers that responded here today, this individual would have caused a lot of harm, and he was not able to do that,” Perez said.

Perez described a scene at the resort outside Miami that began with bizarre behavior before quickly turning dangerous.

The gunman came onto the property, took down an American flag from the rear part of the complex and draped it on a counter in the hotel lobby before he began yelling “anti-Trump, President Trump, rhetoric,” Perez said.

The luxury hotel is part of Trump National Doral Golf Club, an 800-acre resort owned by Trump outside Miami; the president purchased the golf course in 2012 for $150 million.

After yelling about Trump, the gunman then began to open fire in the lobby, prompting people to call police. The officers who headed to the property were confronted by a man wielding a handgun.

Five officers – one from the Miami-Dade department, four from Doral – exchanged fire with him, Perez said.

Perez said his department is investigating the motivation and what led up to the shooting, with assistance from the Secret Service and the FBI. Authorities are considering the shooting a state crime so far, though they are investigating whether there were any federal crimes committed, he said.

The Secret Service said none of the people it protects were in the Miami area when the shooting occurred. The agency said in a statement that it was aware of the shooting and had dispatched special agents from its Miami field office to the scene.

The Florida Department of Law Enforcement said Friday that it is investigating the officer-involved shooting part of what happened at the request of the Miami-Dade police. Video footage did capture what happened, but police have said they do not immediately intend to release it, citing the open investigation.

Court records showed that Oddi appeared to have a number of traffic infractions, but no other criminal history could immediately be found. It was not clear whether he had an attorney.

Perez said police are still investigating how the gunman was able to enter the resort. Authorities were at Oddi’s home Friday morning and preparing to search the property.

Doral Police Chief Hernan Organvidez said at an earlier news briefing that there was no need to evacuate the hotel because the threat was quickly dealt with, adding that the violent encounter lasted less than two minutes.

Eric Trump, one of the president’s sons who helps manage the company, tweeted a message of thanks to the police officers who responded to the shooting, “A huge thank you to the incredible men and women of the @DoralPolice Department and @MiamiDadePD. Every day they keep our community safe. We are very grateful to you!”