This paper introduces the structural threshold regression model that allows for an endogeneous threshold variable as well as for endogenous regressors. This model provides a parsimonious way of modeling nonlinearities and has many potential applications in economics and finance. Our framework can be viewed as a generalization of the simple threshold regression framework of Hansen (2000) and Caner and Hansen (2004) to allow for the endogeneity of the threshold variable and regime specific heteroskedasticity. Our estimation of the threshold parameter is based on a concentrated least squares method that involves an inverse Mills ratio bias correction term in each regime. We derive its asymptotic distribution and propose a method to construct bootstrap confidence intervals. We also provide inference for the slope parameters based on GMM. Finally, we investigate the performance of the asymptotic approximations and the bootstrap using a Monte Carlo simulation that indicates the applicability of the method in finite samples.