The Port of Los Angeles is among the busiest in the world. For the cops who protect it, keeping an eye on the docks is a challenge like no other.

If you ever wanted to know how your clothes got to the mall, your iPhone arrived at the Apple Store, or the gas in your tank made its way from the Middle East to that Shell station, the best place to start without leaving the country is the Port of Los Angeles. The scale of the place is nearly impossible to grasp. A broad expanse of concrete, it covers 7,500 acres, with 43 miles of shoreline that trace a labyrinth of channels, berths, and marinas. Here and there freighters that stretch almost a quarter mile long and ten stories above the water float idle as skyscraping, four-legged cranes unburden them of multicolored stacks of steel containers. Against a backdrop so colossal, even tugboats and trash barges look tiny. Each year roughly 2,000 such freighters come through the harbor carrying 40 percent of the shipping containers that come to America, making it the busiest port in this country and the 19th most bustling on the planet. Make that the ninth if you combine it with the adjacent Port of Long Beach.

Tasked with patrolling this alien landscape are the 130 sworn officers of the Los Angeles Port Police. It’s an odd occupation. One moment a port cop could be ticketing a speeding semi or responding to a domestic disturbance call in Wilmington or San Pedro, the two neighborhoods that bleed into the port’s borders; an hour later he might be boarding a cruise ship to look for explosives or diving 50 feet down into water so dark and cloudy that he can rarely see more than an arm’s length in front of him. Which can pose a challenge when searching for a corpse or checking whether dope has been stashed beneath a hull.

“There’s a lot of activity here—a lot of people coming in and out of this harbor,” LAPP sergeant Ralph Edwards told me one morning this past November as he stood on the docks in Fish Harbor. The water was dead-still, and a seal could be spotted popping above the surface. “You never know what you might find, especially underneath the big ships.” Edwards oversees the department’s dive team, a crew of four full-time members and 21 part-timers that was founded in 1989. Five feet, six inches and stocky with close-cropped brown hair, the sergeant speaks in a soft voice and often seems to be suppressing a smile. The effect can be disarming, adding an extra tinge of earnestness to everything he says. As the captain of a Cal State Northridge marine biology research boat tended to his craft a few feet away, Edwards, who’s 46, explained that a small sunken craft had recently been reported by a commercial diver. “We’re going to measure it, try to get a name or serial number, and make sure it’s not a safety hazard,” he said. Beside him Sergeant Philip Heem and Sergeant Nathan Blair were each putting on a layer of tight synthetic fleece to stay warm. Next they shimmied into black dry suits, which are kind of like astronaut suits but sealed at the wrists, ankles, and neck to keep contaminated water out. With his tank on, Heem affixed a GoPro camera to his mask, and Blair made sure it was snug. The men checked their earpieces and mikes, then jumped in, flippers first, vanishing from view about six feet down. A thin column of bubbles was the only clue they were there at all.

The boat they were investigating could have accidentally sunk decades ago or simply been ditched. Edwards wasn’t all that concerned, but he didn’t want to take chances. “When you understand the economic importance of the port,” he told me later, “it starts to change your perspective. I’m aware that I’m entrusted to make sure that this much larger scale of activity is going smoothly.”

A few months from now, in February, an armada of freighters would be queued up beyond the two-mile breakwater, a century-old barrier that protects the port from the powerful swells of the Pacific Ocean. With members of the International Longshoremen and Warehouse Union up and down the West Coast demanding better wages and benefits, the standoff caused a newsworthy slowdown. Trains and lines of tractor-trailers waited to be loaded. Boxes stayed in containers. Produce from local farms rotted rather than going to distant shores. Imports fell by 25 percent in some places, and companies lost millions in revenue. Hundreds of millions more dollars were said to be at stake when President Obama sent Secretary of Labor Tom Perez to California to settle a dispute that highlighted the inextricable ties between our port and the global economy.

Those ties motivated security experts to think a great deal about the port after the 9/11 attacks. If it were big enough and orchestrated well enough, an attack on the harbor could have ruinous financial impact. “Markets would wobble because in carrying out such an attack, the terrorists would demonstrate capability far beyond what we think they now have and underscore the nation’s vulnerability,” says Brian M. Jenkins, who has studied terrorism and homeland security for more than 40 years and is a senior adviser to the president of RAND. “A separate reason for market wobble,” he added, “would be anticipation of the consequences of the attack in terms of the U.S. escalating its military efforts abroad—sending in troops, et cetera—and what long-term effects that might have on the economy.”

Preventing such an attack is one reason that Ralph Edwards’s dive unit exists. Another is to slow the flow of drugs that inevitably come through the port. But when you have an operation this large, the looming question is: How?

Photograph by Spenser Lowell

Ask anyone in the LAPP and they’ll tell you that there is no port policing force in the world as highly trained as theirs. Personnel from as far away as Taiwan and Nigeria have come to get schooled at the LAPP’s Maritime Law Enforcement Training Center, which teaches the nuances of policing on, in, and around water—everything from boat chases to self-defense to standard board-and-search procedures. Led by the LAPP and cops from other local agencies, like the Long Beach Police Department, it’s one of two such institutions in the country and the sole police-training program where you’ll find agents at the state and federal levels taking orders from municipal cops.

The MLETC is run by the L.A. Port Police’s deputy chief, Paul J. Lipscomb. A husky 61-year-old with a meaty handshake and a horseshoe of gray hair, he has been a sheriff’s deputy, a Secret Service agent, and a cop at LAX. Lipscomb came to the port in 2006 and soon began to wrangle support to establish the MLETC. Sitting in his office during a lunch break, where framed photos show his younger, trimmer self standing beside presidents Ford and Reagan and George H.W. Bush, Lipscomb offered up the elevator pitch for the program: “The requirements for policing on and around water are very specific, from cabin searches to using a firearm on a boat or dock that’s not steady.”

And so it was, despite my better instincts, that I found myself charging at a fit, wiry U.S. Customs and Border Protection agent in his midthirties as he stood at the edge of a swimming pool in Long Beach, his back to the water. The officer, Louie—he asked me to withhold his last name—stepped aside and threaded his right arm over my shoulder and onto the back of my neck, immobilizing my head and causing me to hunch forward. With his left hand on my midback, he used my momentum to toss me into the pool. By the time I surfaced, Louie already had his red plastic training gun pointed at my face.

Before practicing “water survival,” Louie and I had spent several hours with seven other students—including a pair of Orange County sheriff’s deputies, a Fish and Wildlife agent, and an FBI guy—during which we were taught the vagaries of maritime terminology. (Gunwale is pronounced “gunnel,” in case you were wondering.) The chalkboard session was followed by hours of “swim assessment” at the pool, where we learned, among other things, that the frog stroke is the most energy-efficient way to move through water in clothes and heavy boots. And this: You can use your pants as a flotation device. Just knot the legs together, loop them behind your neck, splash water into the open end to make air bubbles, then clamp the waist shut to trap them. Duh.

Water survival was taught by a muscular, tattooed port cop I’ll call Frank, who looked like a cross between a South Bay surf bro and an MMA fighter. For hours each pair participated in drills, squaring off as cop and suspect, then switching roles. At one point as I played cop, Louie was to push me in the pool, count to five, and dive in with the intent to finish me off. Weighed down by my Kevlar vest and sodden clothes, I barely had time to swim away, go under to unholster my fake gun, and then reemerge with it drawn. Then we repeated the drill but with just three seconds before Louie could dive in; he was on me so fast that I’d have had no choice but to shoot.

During another drill, we took to the docks, where a trio of students responded to a mock call from a passenger (actually a teacher) who said he’d come back to his boat to discover the cabin hatch open. Lieutenant Aaron Mascorro, a Long Beach police officer and MLETC instructor, looked on. “Boats are made up largely of empty space,” he said to me quietly. As he spoke, one brawny student squeezed into the crawl space beneath the steering wheel, his legs still protruding as he yelled “Freeze!” and apprehended the perp (another teacher). “There’s no place to run,” said Mascorro. “But there are plenty of places to hide.”

Line up all of the shipping containers that enter the port each year, and you’d have to circle the globe, then make a round-trip between Seattle and Chicago. That leaves a lot of places to stash bombs, drugs, and on occasion, people. The port police are responsible for patrolling by car, by boat, and by scuba, keeping the channels clear, checking ship hulls, and inspecting cruise ships before departure. But unless an underwater hull check is in order, the cargo and fuel vessels are the responsibility of U.S. Customs and Border Protection, an agency so buttoned-up that it won’t divulge how many searches it conducts on containers in the port each year. According to Lipscomb, the figure is 3 percent.

Twenty-four hours before every U.S.-bound container is loaded onto a vessel, a Customs official stationed in that country reviews an electronic manifest cataloging its contents. Anything suspicious—say, a load of sneakers shipped by a company that usually transports furniture or a container of Droids from someone loosely affiliated with a known counterfeiter—is red-flagged for a search at its port of entry. “These inspections are intelligence driven,” says the agency’s coastal branch chief, Jaime Ruiz, who’s stationed at the Port of L.A. “They’re not random at all. We know exactly which containers to look for.” Sometimes, though, Customs makes fluke discoveries. In 2005, for example, there were two instances where authorities discovered Chinese nationals who had been smuggled over in shipping containers.

Customs doesn’t publicize detailed estimates of how much contraband is seized or slips through the cracks. And even if it did, numbers concerning the latter would be impossible to confirm. “We simply don’t know what we don’t know,” says Jenkins, who was also a transportation and safety consultant for President Clinton, has written dozens of papers on the topic, and has testified before Congress on such matters. “You might see statistics that say we’re intercepting 10 or 20 percent of whatever it is we’re finding. But those are wild guesses. We simply can’t monitor what’s getting through, and don’t believe anyone who tells you otherwise.”

Any time a ship arrives at the port, a team of Customs officers, often with dogs, will board it and perform a cabin-to-cabin, hatch-to-hatch search. Drugs, stowaways, pests, explosives—there’s a long list of what shouldn’t be there, though the agency’s main focus here is antiterrorism. Containers marked for inspection are set aside. “Hot” ones—boxes that might contain people, illegal drugs, or explosives—are placed on the docks, with officers rolling out a mobile X-ray machine for an initial scan before they crack open the boxes. Another agency, like the ATF, might be present, too, depending on the circumstances.

The second-tier inspections occur at off-site storage areas and usually turn up counterfeit goods. During a three-month span in 2014, Customs and EPA officials found more than 700 vehicles and pieces of motorized equipment, like go-karts and outboard engines, shipped from Asia that were in violation of the Clean Air Act. In 2013, a haul of 16,000 counterfeit Hermès handbags was seized, and in 2011, more than 22,000 cartons of knockoff Marlboro cigarettes were intercepted.

Regardless of whether it’s been flagged for inspection, every container that leaves the complex is driven through a portal at the facility’s exit to check for radioactive materials, a concern that had importers on high alert after Japan’s Fukushima nuclear power plant meltdown in 2011.

Sometimes smugglers try to get the goods off the ships before the searches. In 2004, Customs officers caught a man in a wet suit walking across a cargo terminal; the port police scuba team was dispatched and found a backpack of heroin and cocaine stashed under an elevated portion of the docks. The suspect had hidden the cache there after swimming to a ship to fetch it.