After Ernesto Godinez allegedly shot an ATF agent in the face last Friday near his home in the Back of the Yards, the area around the crime scene was crawling with cops and federal agents for hours.

Godinez’s older brother, Rodrigo “Gordo” Godinez, apparently feeling their presence, locked the door to the basement of his apartment building in the 4300 block of South Wood — about one block from his brother’s place, prosecutors said at a detention hearing Thursday at the Dirksen Federal Courthouse.

A short time later, federal agents searched Rodrigo’s home and found $8,500 hidden in the basement ceiling.

It did not surprise them.

They were the same marked bills an undercover ATF agent had paid Rodrigo, 37, for about half a pound of cocaine a few days earlier, Assistant U.S. Attorney Nic Eichenser said.

A few feet away, also in the ceiling, was a pistol and several boxes of ammunition, he added.

The evidence was enough for U.S. District Judge Maria Valdez to deem Rodrigo Godinez a danger to the community and order him to remain locked up.

Ernesto Godinez

Ernesto Godinez has been charged in the shooting of a federal agent Friday in the Back of the Yards neighborhood. | Chicago Police Department photo

The Godinez brothers are leaders of the Almighty Saints street gang, prosecutors allege.

To drive home the “sway” that Rodrigo has in the neighborhood, Eichenser noted the 40 to 50 people who gathered outside his apartment building when federal agents arrested him.

“Rather than causing a scene,” Rodrigo agreed with law enforcement that “going out the back way was the best option,” Eichenser said.

The gang had come under the microscope of an inter-agency law enforcement task force created last year to combat the city’s gun violence.

On Friday, Godinez’s younger brother, Ernesto, 28, allegedly shot an ATF agent in the face as a tracking device was being replaced on a car near his home in the 4400 block of South Hermitage.

The task force was acting on information that a gang in the neighborhood recently obtained a cache of weapons to “get ready for the summer,” a source said.

The wounded agent was released from Stroger Hospital Wednesday and is expected to make a full recovery.

They were “ambushed,” said Celinez Gomez, the special agent in charge of the ATF’s Chicago field division.

Ernesto is also in federal custody and has been charged in the shooting.

A slew of ATF agents have attended initial court appearances for the brothers. On Thursday, several agents tapped fists on their way out the courtroom.