A Trinitarios gang leader will get between 35 and 40 years behind bars after admitting Thursday to a string of carjackings and shootings, including one that ended in murder, in Brooklyn Federal Court Thursday.

Amaury Guzman, 26, told a Brooklyn Federal Court judge he took part in the Nov. 20, 2022, killing of Tao Wu, who was shot to death during a botched BMW carjacking on 37th St. near Parsons Blvd. in Flushing.

“With the intent of causing such harm, as the result of my intentional actions, someone died,” Guzman said in Spanish Thursday.

Guzman, fellow Trinitarios member Jonathan Rodriguez and others had already stolen a Mercedes-Benz sedan from a driveway in Carteret, N.J., when they headed to Flushing, where they found the 25-year-old Wu sitting in a parked BMW 440 coupe.

Rodriguez got out of the Mercedes and approached Wu, who drove off — so Rodriguez opened fire, hitting Wu in the back, the feds allege. The BMW flipped over, and the carjacking crew drove off. Wu died of a gunshot wound to the back.

Guzman agreed to a negotiated sentence of 35 to 40 years behind bars, which means U.S. Chief District Court Judge Margo Brodie must stay within that range when she sentences him Aug. 18.

Rodrgiuez, 24, who previously took a plea deal, faces 32 to 40 years behind bars.

“Guzmán and Rodríguez caused fear and chaos through armed carjackings, robberies and ruthless shootings,” U.S. Attorney Joseph Nocella said Thursday.

Wu’s murder happened in the midst of a four-day crime spree in Queens, which started on Nov. 19, 2022, when Guzman, Ruffi Fernandez, 26, and other unnamed accomplices tried to rob a pot dealer in Queens, approaching the victim in a car and shooting his passenger in the neck, according to prosecutors.

The passenger survived, after extensive surgery to remove the bullet.

Two days after Wu’s killing, on Nov. 22, 2022, Guzmán, Rodríguez and their crew — in the same stolen Mercedes they used to approach Wu — rolled up on a man on Kent St. near 80th Dr. in Jamaica Estates. They tackled him to the ground, and robbed him at gunpoint of his car, his cell phone and two envelopes with nearly $14,000 cash, the feds allege.

The crooks sped off in both luxury sedans, but the victim was able to track his phone using an app on his wife’s phone, and when cops caught up to the robbers, the BMW crashed into the Mercedes in a botched escape attempt. Investigators found a ghost gun in the wrecked Mercedes that matched the ballistics of the Nov. 19 and Nov. 20 shootings.

Guzman managed to escape that night, and kept on committing carjackings, on Dec. 12, 2022, in Murray Hill in Manhattan and another on Feb. 1, 2023, in Maspeth, Queens.