SOUTH PORTLAND — A man who was suffering a mental health crisis created a standoff with police that lasted for more than six hours Monday night before he set himself on fire.

A team of police officers rushed into the three-story, brick apartment building shortly after 9 p.m. and used a fire extinguisher to put the fire out. Police said the man had barricaded himself inside the apartment at 344 Broadway.

South Portland police said late Monday that the man was taken into protective custody and transported to Maine Medical Center in Portland, where he was being treated for non-life threatening burns. He will also be evaluated by the hospital’s psychiatric staff.

Police could see the interior of the man’s third-floor apartment from Margaret Street – the building is at Broadway and Margaret Street – and when they saw him douse himself with a liquid, they rushed up a rear stairwell and burst through the door of the apartment.

“It is not anticipated that this male will face criminal charges, but we are also not anticipating that he will be released from the hospital, or a similar setting in the near future,” Sgt. Steve Webster said in a news release.

“We are not releasing the man’s name because he was clearly in crisis, it doesn’t appear that he committed a crime that he will be charged with, and his family doesn’t yet know about the incident,” Webster added.

South Portland police were called to the apartment building at 2:40 p.m. after being asked to check on the well-being of a man who “had been experiencing mental health issues and was in crisis.”

When officers arrived, they were unable to make contact with the man, but they were fairly certain he was inside.

Members of the Southern Maine Regional SWAT team, which consists of officers from South Portland, Cape Elizabeth and Scarborough, were called in because of the threats that the man had made to an acquaintance.

“We have a person who is in a mental health crisis, who has made some suicidal comments,” Webster said near the beginning of the incident.

Police obtained a search warrant and over a period of time officers established contact with the man through his apartment door.

Robert Libby, the South Portland Police Department’s court officer and crisis negotiator, used a bullhorn to communicate with the man, who Webster said is about 30 years old.

Dozens of people gathered on sidewalks near the building to watch and listen as Libby tried to persuade the man to leave his apartment.

Shortly after 8 p.m., the man dropped two handwritten notes, which floated from his apartment window onto the ground. Police collected the notes and tried to respond to what he had written.

“Please make contact with us,” Libby said. “I know you don’t know what is going on, but we’ve got to do this together as a team.”

Webster said police were fairly certain the man was not armed, but they decided not to take any chances and moved cautiously around the three-story apartment building.

Members of the SWAT team were heavily armed and pointed their rifles toward the third floor apartment for a brief period.

When the officers moved in to collect the handwritten notes, they used an armored Humvee for cover.

No one was injured during the standoff.

“I think the police officers and the negotiator showed an incredible amount of patience. If they hadn’t it could have ended a lot differently,” Webster said.