The paper is concerned with the further development of a new and general nonlinear steepest descent-type method for analysing the asymptotics of oscillatory Riemann-Hilbert (RH) problems proposed earlier by the authors [Ann. Math., II Ser. 137, No. 2, 295-368 (1993; Zbl 0771.35042
)]. The main purpose of the paper is to give a rigorous justification of certain well-known asymptotic results for the second Painlevé equation and to derive directly error bounds by using the steepest descent method. The method proceeds by deforming contours, and in the simplest cases the RH problem localizes near the points of stationary phase and the localized RH problems can be solved explicitly in terms of classical special functions, though in more complicated cases the RH problem localizes on a line segment rather than at the stationary phase points. The solution of the RH problem localized on a segment occupies the major part of the paper.