Aims. We present cosmological constraints from a joint analysis of type Ia supernova (SN Ia) observations obtained by the SDSS-II and SNLS collaborations. The dataset includes several low-redshift samples (z< 0.1), all three seasons from the SDSS-II (0.05 <z< 0.4), and three years from SNLS (0.2 <z< 1), and it totals 740 spectroscopically confirmed type Ia supernovae with high-quality light curves. Methods. We followed the methods and assumptions of the SNLS three-year data analysis except for the following important improvements: 1) the addition of the full SDSS-II spectroscopically-confirmed SN Ia sample in both the training of the SALT2 light-curve model and in the Hubble diagram analysis (374 SNe); 2) intercalibration of the SNLS and SDSS surveys and reduced systematic uncertainties in the photometric calibration, performed blindly with respect to the cosmology analysis; and 3) a thorough investigation of systematic errors associated with the SALT2 modeling of SN Ia light curves. Results. We produce recalibrated SN Ia light curves and associated distances for the SDSS-II and SNLS samples. The large SDSS-II sample provides an effective, independent, low-z anchor for the Hubble diagram and reduces the systematic error from calibration systematics in the low-z SN sample. For a flat ΛCDM cosmology, we find Ωm =0.295 ± 0.034 (stat+sys), a value consistent with the most recent cosmic microwave background (CMB) measurement from the Planck and WMAP experiments. Our result is 1.8σ (stat+sys) different than the previously published result of SNLS three-year data. The change is due primarily to improvements in the SNLS photometric calibration. When combined with CMB constraints, we measure a constant dark-energy equation of state parameter w =−1.018 ± 0.057 (stat+sys) for a flat universe. Adding baryon acoustic oscillation distance measurements gives similar constraints: w =−1.027 ± 0.055. Our supernova measurements provide the most stringent constraints to date on the nature of dark energy.