The border was agreed in the Treaty of Lalla Maghnia .
The border is essentially the modern border between Morocco and Algeria .
The border , which is essentially the modern border between Morocco and Algeria , was agreed in the Treaty of Lalla Maghnia .