Abstract: What is the impact of automation on trade? This paper studies the impact of industrial robots on US manufacturing firms, with a focus on trade and offshoring. I construct a parsimonious model of two-stage production that incorporates automation and offshoring in both production of intermediate inputs (upstream production) and assembly (downstream production). I then develop a novel instrumental variables strategy based on immigrant inflows of robot-complementary workers to examine the impact of robot adoption on firm-level outcomes. Using a detailed administrative dataset of US manufacturing firms, I find that at the firm level, robot adoption has a positive effect on imports of both intermediate inputs and final outputs, but the effect is significantly larger for input imports. Robot adoption also leads to an increase in sales and productivity, and an increase in employment and wages favoring non-manufacturing workers. These empirical findings are consistent with predictions of the model and the hypothesis that robots are mainly used in assembly. Quantitative estimation of the model confirms the comparative advantage of robots in downstream production. Following a positive shock to productivity of robots, robot adopters increase their sales, imports, and expenditure on domestic inputs but not domestic assembly, while non-adopters contract in all dimensions due to within-industry competition. In aggregate, the rise of industrial robots in the US between 1992 and 2012 is associated with a 15% increase in imports and a 14% decrease in domestic manufacturing employment, with significant heterogeneity across different types of imports and workers. I use the estimated model to evaluate costs and benefits of robot taxes and subsidies.