This paper presents a model-based extremum seeking approach for a class of single-input–single-output nonlinear systems, with the analytic form of the performance function unknown a priori. We focus on a practically implementable design with robustness to model uncertainties and disturbances. A discrete-time sliding mode gradient estimator is developed for estimating the gradient of the performance profile. Based on the estimate, a variable structure output feedback regulator is proposed to enforce the system states toward the optimal trajectory. We analyze convergence conditions of the switching system toward a neighborhood of the optimal trajectory, and establish an ultimate bound on the size of the neighborhood. The robustness of the proposed controller is discussed with respect to measurement noise.