Host countries have implemented permanent and guest-worker (GW) immigration programs in recent decades, while the temporary movement of service providers under Mode IV of the GATS is one of the issues being negotiated at the Doha Round of the WTO. Though decisions on what programs to adopt have acquired increased urgency, the task has been complicated by host countries' concern with migrants' massive overstaying in past GW programs. This paper contributes to the debate by examining these migration regimes in a model in which the host country maximizes an objective function with respect to i) the size of the migration program, and in the case of temporary migration ii) the value of a bond employers must buy and iii) the share of migrants' income whose payment is deferred. The maximization also takes into account the impact of the policy on source country cooperation on illegal immigration, migrants' incentives and their preference for overstaying. The model solves for the policy measures, the overstaying probability, and the level of illegal migration. The paper concludes that the optimal policy is a combination of Mode IV-type and permanent migration.