For extrasolar planets discovered using the radial velocity method, the spectral characterization of the host star leads to a mass-estimate of the star and subsequently of the orbiting planet. In contrast, if also the orbital velocity of the planet would be known, the masses of both star and planet could be determined directly using Newtons law of gravity, just as in the case of stellar double-line eclipsing binaries. Here we report on the detection of the orbital velocity of extrasolar planet HD209458b. High dispersion ground-based spectroscopy during a transit of this planet reveals absorption lines from carbon monoxide produced in the planet atmosphere, which shift significantly in wavelength due to the change in the radial component of the planet orbital velocity. These observations result in a mass determination of the star and planet of 1.00+-0.22 Msun and 0.64+-0.09 Mjup respectively. A ~2 km/sec blueshift of the carbon monoxide signal with respect to the systemic velocity of the host star suggests the presence of a strong wind flowing from the irradiated dayside to the non-irradiated nightside of the planet within the 0.01-0.1 mbar atmospheric pressure range probed by these observations. The strength of the carbon monoxide signal suggests a CO mixing ratio of 1-3x10-3 in this planets upper atmosphere.