To whom did the foreigners lose most of their acquired lands?