HIDALGO — Past the pig farm, beyond the landfill and among several deflated rafts along the banks of the Rio Grande, a Border Patrol boat hummed slowly upstream.

A loud bang sounded off in the distance, and three agents turned toward what’s known as Rock Alley, a steep bluff where the river bends sharply and the water between Mexico and the United States narrows.

Scouts mask as fishermen, some without bait on the end of their rods, along the edges of the alley. This, agents say, is the most dangerous stretch on the river between the new Hidalgo Pumphouse and a dam west of Hidalgo.

Other scouts often wander along the top of the bluff, notifying smugglers at other points along the river when to send narcotics and victims of human smuggling across.

“Hopefully, that’s just a firework,” Sean O’Loughlin, a vessel commander, said of the bang heard during a Wednesday morning shift.

Another noise then rang out seconds later.

“You guys good?” radioed an agent aboard a boat shortly downstream.

O’Loughlin responded: “10-4. Looks like there’s some activity up by Rock Alley.”

Two more similar noises were heard soon thereafter, but agents remained uncertain whether it was fireworks or gunfire.

Because the danger that lies on the other side of the river is often unknown to them, agents who patrol by boat are in a constant state of high alert.

Near Brownsville, an agent assigned to the Riverine Unit, which patrols the river by boat, recently suffered a grazing wound to the back of his head after being shot from Mexico, according to a Border Patrol statement.

The agent sustained a “non-life-threatening injury from a small caliber weapon,” the statement read. “The incident is currently under investigation.”

Agents are trained to look for specifics on both sides of the river.

“We’re out in the open; no protection for us,” O’Loughlin said. “I mean, at any given moment someone could pop out and throw a rock or take off a shot.”

This patrol also passes under the Hidalgo-Reynosa International Bridge, where scouts linger on the Mexican side of the bridge. Sometimes they’ll drop rocks or buckets of urine on the agents as they pass underneath. People have also hung fishing hooks to try to injure agents.

“Hasn’t happened to me, thankfully,” O’Loughlin said.

As the boats rumbled under the bridge Wednesday, another vessel commander, Enrique Rodriguez, waved at two men standing on the bridge. One shouted and waved his arm several times, pointing toward the United States.

“They already passed,” the man said, apparently referring to a group of immigrants that had already illegally crossed the river.

After more routine patrolling, the boats sped toward Rock Alley. Some people flung fishing rods; others dropped nets.

But the noises that rang out were on the agents’ minds. Such is the need to be on guard in the area that agent Marcelino Medina had his hand on his holster while the boats approached the alley.