This paper analyses the effect of public expenditures in a modified Solow model of capital accumulation with optimizing agents. The model identifies optimal government size and composition of public expenditures which maximize the rate of growth in the dynamics to the steady state and the long-run level of per capita income. Different allocations of public resources lead to different growth rates in the transitional dynamics depending on their elasticities. However effects from fiscal policy are only temporary. Finally we argue that neglecting the non-linear nature of the relationship between government spending and growth may lead empirical studies to biased results.