A man from North Carolina surrendered himself to authorities after holding a woman and a 2-year-old child hostage in a hotel room in Florida for over eight hours.

Before surrendering, the man tried to set the hotel room on fire and also opened fire at SWAT team members, Tampa Bay Times reported.

Deputies with the Hillsborough County Sheriff’s Office arrived at the scene late Sunday after receiving a phone call saying a man had barricaded himself inside a Tampa hotel room, and he had a firearm.

The responding deputies confirmed the man was holding the woman and the toddler, who were believed to be his family members, hostage inside the room. A SWAT team was called to the scene and the negotiators tried to get in touch with the suspect, later identified as 53-year-old Victor Hernandez, and the family members, but couldn’t. It wasn’t clear if the woman and toddler were the suspect’s wife and child.

"We attempted to provide them with a phone, he refused to take any type of phone at all – again, would only yell out certain obscenities or little comments that he would make throughout the night. This subject was extremely, extremely agitated," the Hillsborough County Sheriff Chad Chronister said in a press conference Monday, NBC-affiliated television station WFLA reported.

The suspect "got out of control" and opened fire inside the room. He also attempted to set the room on fire. The irate man then shot at the SWAT team members who were trying to negotiate with him, "intentionally trying to strike one of them," Chronister said.

"Matter of fact, one of our SWAT team members – from some type of, we believe from the fragment of the bullet – was struck in the face and has a minor laceration to his face. Luckily, that’s the extent of the injury here today," he said.

After over eight hours, the man surrendered himself. Investigation revealed the man was from North Carolina and was vacationing with his family in Florida.

The man appeared in court Monday and was charged with false imprisonment and aggravated assault on a law enforcement officer. The woman and the toddler were checked by medics at the scene and were reported to be fine.

police tape
Among the arrested individuals in Operation Boo Dat were Tier 3 sex offenders. This is a representational image of a police tape at a SunTrust Bank in Sebring, Florida, on Jan. 23, 2019. Joe Raedle/Getty Images