Governments have strong incentives to allow their inventors to free ride on foreign technologies. They can achieve this result by discriminating against foreigners in the patent system---by refusing to grant foreigners a patent for their inventions. International patent law treaties forbid this practice, which may lower the global innovation incentives and may hurt international trade. Using data on half a million inventions submitted to the Chinese patent office, we find robust evidence of anti-foreign bias in the issuance of patents in `strategic' technology areas. Foreigners are about 50 percent more likely to be refused a strategic patent than locals.