An adaptive robust control method is proposed for underactuated mechanical systems (UMSs) with uncertainty in the paper. UMSs are supposed to follow prescribed constraints when there is uncertainty. Inspired by the Udwadia–Kalaba modeling approach, those constraints are considered as control objectives realized by robust control. The uncertainty considered in UMSs is characterized as time‐varying and bounded, albeit with unknown bounds. In order to estimate the boundary information, a novel adaptive law is developed. By using the Lyapunov function, the UMS is guaranteed to be uniform boundedness and uniform ultimate boundedness. The simulation is validated by using a two‐wheeled bicycle as an example, compared to conventional PD control methods. The simulation comparison results show that the proposed control method exhibits notable characteristics, including fast transient response, small overshoots, and good robust performance.