A 27-year-old man is accused of crashing a car carrying several cans of gasoline into the emergency entrance of Middlesex Hospital in Middletown, Connecticut, just before 10 a.m. Thursday and setting himself on fire, according to officials.

Officials identified the suspect as Middletown resident Steven Ellam.

Ellam was airlifted to Bridgeport Hospital, where he is in critical condition, according to officials.

A security guard who was helping evacuate patients immediately after the incident was also taken to the hospital with smoke inhalation. No other injuries have been reported.

Ellam's motives are unclear, according to local officials. As they investigate, emergency officials are evacuating homes in the vicinity of the man's residence.

Hospital officials said patients are safe, but the emergency department of Middlesex Hospital is closed and patients have been evacuated and moved to other areas of the hospital.

The Middlesex Hospital emergency department is closed and all outpatient services at the hospital's Middletown location have been suspended until further notice. Visitors are prohibited until further notice except in special circumstances. Anyone who needs to check on a loved one should call 860-358-6000.

MidState Medical Center, both campuses of The Hospital of Central Connecticut and Hartford Hospital are accepting patients who have been diverted.

Residents in the area of Crescent Street in Middletown are being asked to shelter in place after a car crashed into Middlesex Hospital.

Middletown Mayor Dan Drew said during a news conference that local officials believe this was an isolated incident, but other municipal, state and federal authorities have been called in to assist in clearing the vehicle and the man's home as a precaution.

The Middletown Police Department, Connecticut State Police, Hartford Bomb Squad, FBI, State's Attorney's Office are all involved in the investigation.

Police officials said the suspect has been known to the Middletown Police Department since he was a teenager and has a criminal record dating back years.

Mayor Drew said police secured other important buildings in town, including schools, but there is no reason to believe the buildings or people in them are in danger.

A neighbor who witnessed the crash reported seeing the man on fire and hearing screams for help.

A driver crashed into Middlesex Hospital in Middletown Friday morning and a witness describes a horrifying scene with someone on fire.

"Just heard an explosion. I got up, looked out the back window and then I looked at the hospital and that's when I saw the car in there, and then I saw a guy come running out with -- he was on fire, screaming for mercy and he just kept screaming and screaming and some guys ran up to him, threw something on him, put him on the gurney," said Gary Mills, who lives right across the street from the hospital.

Another witness said the man appeared to be naked.

A hospital spokesperson said one person was in the car when it went down the one-way street and crashed into the entrance around 10 a.m.

We will be holding a press conference at noon regarding the emergency at Middlesex Hospital. At this time we don't believe there is any threat to the community and we believe this to be an isolated incident. — Daniel Drew (@MayorDanDrew) February 22, 2018

Other hospitals in the area have added extra security as a precaution.