This paper addresses the impact of endogenous technology through research and development (R&D) and learning by doing (LbD) on the timing of environmental policy. We develop two models, the first with R&D and the second with LbD. We study the interaction between environmental taxes and innovation externalities in a dynamic economy and prove policy equivalence between the second-best R&D and the LbD model. Our analysis shows that the difference found in the literature between optimal environmental policy in R&D and LbD models can partly be traced back to the set of policy instruments available, rather than being directly linked to the source of technological innovation. Arguments for early action in LbD models carry over to a second-best R&D setting. We show that environmental taxes should be high compared to the Pigouvian levels when an abatement industry is developing. We illustrate our analysis through numerical simulations on climate change policy.