Nitrogen (N) is essential for plant production, but N uptake imposes carbon (C) costs through maintenance respiration and fine-root construction, suggesting that an optimal C:N balance can be found. Previous studies have elaborated this optimum under exponential growth; work on closed canopies has focused on foliage only. Here, the optimal co-allocation of C and N to foliage, fine roots and live wood is examined in a closed forest stand. Optimal co-allocation maximizes net primary productivity (NPP) as constrained by stand-level C and N balances and the pipe model. Photosynthesis and maintenance respiration increase with foliar nitrogen concentration ([N]), and stand-level photosynthesis and N uptake saturate at high foliage and fine-root density. Optimal NPP increases almost linearly from low to moderate N availability, saturating at high N. Where N availability is very low or very high, the system resembles a functional balance with a steady foliage [N]; in between, [N] increases with N availability. Carbon allocation to fine roots decreases, allocation to wood increases, and allocation to foliage remains stable with increasing N availability. The predicted relationships between biomass density and foliage [N] are in reasonable agreement with data from coniferous stands across Finland. All predictions agree with our qualitative understanding of N effects on growth.