WASHINGTON — The United States and Mexico have a rich, shared history. For more than a century, people have moved back and forth at the border to work. Their toil and industry could have taken place within a well-regulated and mutually beneficial labor market. But in recent years much of their labor has occurred in a vast black market — harming workers, families, security and public finances in both countries.

There is justifiable disappointment at this outcome. We have watched with frustration, from the highest levels of government on each side of the border, as two neighbors have wasted opportunities to help each other.

Our countries ceased cooperating to regulate labor migration in 1965. They understandably rejected the previous history of flawed “bracero” agreements adopted as early as 1942, which contained inadequate safeguards for workers from both countries. But rather than work to fix those flaws, they have since rejected any genuinely cooperative regulation of lower-skilled labor flows.

The sad result has been decades of rampant illegality. Today, by some reasonable estimates, of the 11.7 million Mexican-born individuals living in the United States, almost half (5.6 million) have no legal authorization. The root cause of this tragedy is that past governments did not jointly enact a well-regulated framework for new and lawful flows of labor.