We present a seismic study of the beta Cephei star theta Ophiuchi. Our analysis is based on the observation of one radial mode, one rotationally split l = 1 triplet and three components of a rotationally split l = 2 quintuplet for which the m-values were well identified by spectroscopy. We identify the radial mode as fundamental, the triplet as p_1 and the quintuplet as g_1. Our NLTE abundance analysis results in a metallicity and CNO abundances in full agreement with the most recent updated solar values. With X in [0.71,0.7211] and Z in [0.009,0.015], and using the Asplund et al. (2005) mixture but with a Ne abundance about 0.3 dex larger (Cunha et al. 2006), the matching of the three independent modes, enables us to deduce constrained ranges for the mass (M = 8.2 +/- 0.3 Msun) and central hydrogen abundance (X_c = 0.38 +/- 0.02) of theta Oph and to prove the occurrence of core overshooting (alpha_ov = 0.44 +/- 0.07). We also derive an equatorial rotation velocity of 29 +/- 7 km/s. Moreover, we show that the observed non-equidistance of the l=1 triplet can be reproduced by second order effects of rotation. Finally, we show that the observed rotational splitting of two modes cannot rule out a rigid rotation model.