Guest-worker programs have been providing rapidly growing economies with millions of foreign workers over the last couple of decades. With the duration of stay strictly limited by program rules in some host countries and wages paid to guest workers often set at sub-market levels, many migrants choose to overstay and seek unauthorized employment. The model we develop examines how the wage of illegal aliens and the flow of guest workers transiting to undocumented status are affected by the rules of the program, enforcement measures of the host country, and market conditions facing migrants at home and abroad. Lengthening the duration of official work permits is found to decrease the stock of undocumented workers, but it has an ambiguous effect on their wage. An expansion in the allowed inflow of documented guest workers has a negative impact on the wage of undocumented workers and an ambiguous effect on their stock.