The cargo ship Yacu Kallpa rode impatiently at anchor off Iquitos, Peru, a ramshackle city on a bend in the broad, turbulent waters of the Amazon River. She was a midsize ship, a tenth of a mile long, low-slung, with a seven-story superstructure in the stern and plumes of rust fanning down the hull from her main deck scuppers. She was like any other cargo ship in the world, but with a dark history. At that moment, in November 2015, she needed to get out of town fast.

The captain and crew had a long run ahead, nearly 2,300 miles down the Amazon, then another 4,000 miles north to Tampico, Mexico, and finally to Houston, with lumber harvested from the Amazon rain forest. It was a route the ship and its predecessors had run hundreds of times for more than 40 years, hauling millions of pounds of timber at a time, to supply lumberyards and big-box stores across the United States with the ingredients for the floors, decks, and doors of the typical American home.

In Iquitos, the waters were too shallow for the Yacu Kallpa to dock amid the tin-roofed stilt houses and the brightly painted tourist boats that lined the riverfront. So small workboats were ferrying stacks of lumber from shore, to be lifted into the hold by two onboard cranes. This was a job that could take two weeks under the best of circumstances. The longer it took, the more time customs officials had to prove that the lumber being heaved aboard the Yacu Kallpa had no business being there at all.

As the loading crews worked, 35 inspectors from a government agency called Organismo de Supervisión de los Recursos Forestales y de Fauna Silvestre (Osinfor) were slogging through forests all around Loreto Province. The inspectors were armed with handheld GPS navigators and a few batches of documents that listed the supposed harvest sites and the species of trees on the ship. More often than not, as they visited the sites listed on the paperwork, they found no evidence that any trees had been cut down there—no stumps, no debris, no disturbance—much less the trees listed on the documents. Sometimes there was no suggestion that trees ever grew there in the first place. They’d leave a mark in spray paint and jot a note on a report: “No existe en un radio 50m,” shorthand for no trees logged here, nor within 50 meters in any direction.

The vast scale of illegal logging in the Peruvian Amazon has long been an open secret. Government officials didn’t care, and until recently there was little anyone else could do to stop it. Local activists often died trying. But for a few defiant government agents, this time there was hope. The urgent question: Could they finally prove that enough trees came from illegal logging sites for prosecutors to stop the ship from sending its cargo into the US market?

As the Osinfor inspectors pushed deeper into the Amazonian forests and dockworkers hurried to load the ship, 30 or so staffers at the Environmental Investigation Agency, a nonprofit organization, waited nervously in an office just off Dupont Circle in Washington, DC. They had been developing methods to tie the ship to illegal logging for four years. But at this moment, they just had to wait and see what would happen next. It was up to government agents in Peru and Washington to make stick all the work the EIA staffers and forest inspectors in Peru had done. If everything went right, this would be the last voyage of the Yacu Kallpa.