MEXICO CITY — President Enrique Peña Nieto and his top military commanders flew to a modest fishing village in Mexico’s far northwest on Thursday and made a promise to protect a small porpoise called the vaquita that is on the edge of extinction.

Standing near the dock where the fishermen of the village, San Felipe, unload their catches of shrimp, corvina and sierra, Mr. Peña Nieto ordered the Mexican Navy to take charge of the effort to halt the illegal fishing that has reduced the number of vaquitas to fewer than 100.

The navy patrols — aided by two powerful new boats, along with light aircraft and drones — are part of a broad plan to save the elusive vaquita, the world’s smallest porpoise, which inhabits the northern reaches of the Gulf of California. The vaquita population has been declining for decades; they are vulnerable to the long, curtainlike gillnets set by local fishermen, which accidentally ensnare and kill them.

But the risk that the vaquita could disappear altogether has risen sharply in the past few years, driven by demand for another kind of fish.