We empirically and theoretically study the effects of capital flows on resource allocation within sectors and cross-sectors. Novel data on service firms – in addition to manufacturing firms –allows us to assess two channels of resource reallocation. Capital inflows lower the relative price of capital, which promotes capital-intensive industries – an input-cost channel. Second, capital inflows increase aggregate consumption, which tilts the demand towards goods with high income elasticities – a consumption channel. We provide evidence for these two channels using firm level census data from the financial liberalization in Hungary, a policy reform that led to capital inflows. We show that firms in capital intensive industries expand, as do firms in industries producing goods with high income elasticities. In the short-term, the consumption channel dominates and resources reallocate towards high income elasticity activities, such as services. We build a dynamic, multi-sector, heterogeneous firm model with multiple sectors of an economy transitioning to its steady-state. We simulate a capital account liberalization and show that the model can rationalize our empirical findings. We then use the model to assess the permanent effects of capital flows and show that the long-term allocation of resources and, thus, aggregate productivity depend on degree of long-term financial openness of the economy. Larger liberalizations trigger long-run debt pushing the country to a permanent trade surplus. This tilts long-run production towards manufacturing exporters, which also increases aggregate productivity.