This paper proposes a method for modeling production function of education using a stochastic frontier model with spatial temporal terms. Using a unique dataset that combines school achievement scores with school characteristics from 2005-2008, the efficiency of 4,900 public high schools in the Philippines in converting school inputs into test scores was estimated. Results show that the average inefficiency is at 41% and that there is a significant positive spatial externality in efficiency, which means that efficiency in one school can spill over to its neighbors. The model was found to be robust to various environmental variables included in the estimation. The results of the study will be important to guide policy makers in allocating limited resources to public schools.