The purpose of this paper is to analyze the effects of national and international knowledge flows on innovative activity. Therefore a knowledge production function is estimated with patent applications in Swedish municipalities as the measure of innovation. The knowledge resources applied are R&D investments and high valued imports. In order to account for the importance of proximity, the knowledge resources are expressed as accessibilities. The total accessibility of a municipality is decomposed into local, intra-regional and inter-regional accessibility. The main results indicate that knowledge resources in a given municipality tend to have a positive effect on the innovative activity of another municipality, given that the municipalities belong to the same functional region. Thus, the results of the analysis indicate that knowledge flows transcend municipal borders, but that they tend to be bounded within functional regions. This result holds for both R&D investments and high valued import products.