A New York City firefighter was shot Friday morning in Staten Island when responding to a blaze caused as result of a standoff between authorities and an ex-con.

FDNY Lt. James Hayes was responding to a report of a smoke condition at 6 a.m. caused by Garland Tyree, 38, after U.S. Marshals tried to serve him an arrest warrant, police said in a news conference, according to PIX 11.

When Hayes and other firefighters arrived on the scene, Tyree began to open fire. Hayes was struck in the right buttocks and left calf, and was rushed to Richmond University Medical Center with non-life-threatening injuries.

Shortly after firing, Tyree posted "Today I die" on Facebook, which possibly explains why he remained inside the building after setting it on fire and shooting at authorities: he would rather die than go to prison.

A family upstairs was evacuated, and the fire was brought under control.

Police were working to apprehend Tyree and thought the fight was over after he came out of his house at around 11:40 a.m, reported Silive. However, he began to open fire once more while retreating back into his home. Police returned fire and followed him inside where they found him dead, allegedly from a self-inflicted wound.

Chief of Detectives Robert Boyce informed reporters that Tyree was a gangbanger with ties to the Bloods. He had 18 prior arrests and was released from prison last month, according to the New York Daily News.

A July 26 Facebook post showed that Tyree was convinced he was under surveillance by unidentified people in Washington.

"I checked for available wi fi and FBI van 2 popped up," he wrote. "Am I buggin?"

He also posted that an agency with "their headquarters ... in DC," was logged into his Facebook account, adding the hashtag "#theywontleavemealone."

Police reported that Tyree, who was the CEO and founder of Real Write Publishing LLC, a Staten Island bookstore that ships books across the country, was wanted for a federal probation violation.