(CNN) -- Newark, New Jersey, Mayor Cory Booker ran into a burning building Thursday night to try and rescue a trapped woman, an act of heroism that sent him to the hospital.
Booker talked about the incident on Twitter.
"Thanks 2 all who are concerned. Just suffering smoke inhalation," Booker tweeted. "We got the woman out of the house. We are both off to hospital. I will b ok."
Booker was released from a New Jersey-area hospital at about 11:30 p.m., according to the mayor's spokeswoman, Anne Torres.
"He's home now, getting some needed rest," Torres said.
The incident occurred at a building next to Booker's home, said Newark Fire Director Fateen Ziyad.
The mayor had returned home to see flames shooting out of a second- floor kitchen window. Flanked by three Newark police detectives, Booker rushed into the building, Ziyad said.
The group searched through the smoke-filled apartment calling out the name of a woman believed to be still inside. As the smoke thickened, a voice could be heard shouting "I'm back here in the bedroom," Ziyad said.
The detectives tried to stop Booker from going any further, fearing for his safety.
"We must get her, she could die," Booker said, according to Ziyad.
Breaking away from the detectives, Booker pressed on into the smokey residence and found the woman in the bedroom. He got her out of the home with the assistance of the detectives.
The woman was taken to a hospital and was in stable condition, Ziyad said.
Booker injured his right hand during the rescue.
"Thanks everyone, my injuries were relatively minor. Thanks to Det. Alex Rodriguez who helped get all of the people out of the house," Booker wrote on Twitter.