A gangbanger was killed by police after he set off a smoke bomb, shot an FDNY lieutenant — and wrote, “Today I die,” in an online post — during a desperate bid to evade capture at his Staten Island home on Friday.

“He knew what he was facing,” NYPD hostage negotiator Lt. Jack Cambria said of Garland Tyree, the leader of the Bloods-affiliated gang Nine Trey Gangsters.

With an armed Tyree, 38, refusing to leave the Mariners Harbor apartment, cops flew in his mother, Purcell Tyree, by helicopter from Delaware in an attempt to avoid more bloodshed.

The ex-con swore he’d surrender if he could just talk to her.

The mom had a “sweet,” three-minute conversation with him from a communications van about a block away, Cambria said.

“We’ll deal with this. Come out. We love you,” the mom told her son, according to sources.

He replied, “I love you. I’m coming out now, Mama,” sources said.

He did come out moments later — but not as cops expected.

Clad in a bulletproof vest, Tyree first fired his assault weapon from a side window, hitting a civilian’s car and a police vehicle, at around 11:45 a.m.

He then burst out of his basement apartment with an AK-47 and sprayed bullets at authorities.

Cops responded with heavy gunfire, killing him.

“He knew there were lots of heavily armed police officers waiting,’’ Cambria said of the ­apparent “suicide by cop.”

The standoff began with an attempt to arrest Tyree on a parole violation. A Regional Fugitive Task Force of four US Marshals and four NYPD detectives showed up at his door at 5:45 a.m.

Tyree, who had violated his federal parole by traveling out of the country, refused to let them in — and unleashed a smoke grenade in his apartment to drive them back, law-enforcement sources said.

The task force called the FDNY and the NYPD’s Emergency Service Unit.

Firefighters arrived first to the scene at 15 Destiny Court, where the task force told them Tyree might have a gun, sources said.

Fire Lt. James Hayes, 53, spoke to Tyree through a window, but when the career criminal went ­silent, the 31-year FDNY veteran decided to step inside, fearing Tyree had passed out.

But Tyree shot at Hayes, hitting him once in the leg and again in the buttocks — the first time in 21 years that an FDNY firefighter has been shot in the line of duty.

“I’m hit! I’m hit!” Hayes yelled.

He was in stable condition at Richmond University Hospital.

A task-force member fired one shot at Tyree, who continued to spray bullets at authorities.

Just minutes after the violent altercation, at 6:19 a.m., Tyree wrote the ominous online post that predicted his own death.

Meanwhile, authorities were gathering outside to set up a safety perimeter and summoned hostage-negotiation teams.

“They kicked in my door and it popped off,” Tyree wrote at 6:25 a.m. About an hour later, hostage negotiators reached Tyree on his cellphone, beginning a four-hour dialogue as they tried to get him to surrender.

“During the course of this standoff, the subject fired his weapon on three different occasions,” Police Commissioner Bill Bratton said, adding that no one was injured in those attacks.

Authorities tried to give Tyree a replacement cellphone using a robot when his own phone died, but he wouldn’t take it.



In addition to his mother, Tyree spoke to his girlfriend and his sister, but no one persuaded him.

When he stepped outside the house and opened fire for the last time, cops unleashed their barrage, sending him tumbling back down the stairs and into the house.

Tyree was declared dead at the scene at 12:05 p.m. In his apartment, cops found three handguns, a 30-round banana clip and a 75-round drum clip for his AK-47.

Meanwhile, the NYPD’s Criminal Intelligence Section sent out warnings of “possible retaliation against law enforcement by Blood Gang members (Trey 9).’’

Jake Lemonda, president of the Uniformed Fire Officers Association, recalled how Hayes’ wife “said she always feared she’d get a phone call that he was hurt. She never ever imagined that he would be shot in the line of duty.”

Additional reporting by Lorena Mongelli, Jamie Schram, Jennifer Bain, Leonica Valentine and Danika Fears