The government had a key cooperating witness in the investigation of the Nine Trey Bloods before Tekashi69 flipped — the Brooklyn rapper’s driver.

The driver, Jorge Rivera, testified Monday that he began helping the feds in May 2018, after he was thrown in immigration jail because he is an undocumented immigrant.

He was released in July of last year and returned to his job driving the rowdy rapper. Later that month, Rivera was behind the wheel with Tekashi in the backseat of a Chevy Tahoe when they were rear-ended. Security cameras in the ride captured the dramatic moment when two men identified by Tekashi as Anthony “Harv” Ellison and “Sha” kidnapped the “GUMMO” artist at gunpoint.

“I thought we were going to get killed. And we would be robbed,” Rivera said on the stand in Manhattan Federal Court through a Spanish interpreter.