We study optimal research and extraction policies in an endogenous growth model in which both production and research require an exhaustible resource. It is shown that optimal growth is not sustainable if the accumulation of knowledge depends on the resource as an input, or if the returns to scale in research are decreasing. The model is stated as an infinite-horizon optimal control problem with an integral constraint on the control variables. We consider the main mathematical aspects of the problem, establish an existence theorem and derive an appropriate version of the Pontryagin maximum principle. A complete characterization of the optimal transitional dynamics is given.