An adaptive maximum likelihood estimator based on the estimation of the log-density by $B$-splines is introduced. A data-driven method of selecting the smoothing parameter involved in the consequent density estimation is demonstrated. A Monte Carlo study is conducted to evaluate the small sample performance of the estimator in a location and a regression problem. The adaptive estimator is seen to compare favorably to some standard estimates. We show that the estimator is asymptotically efficient.