We report on a measurement of the cosmic ray energy spectrum with the IceTop air shower array, the surface component of the IceCube Neutrino Observatory at the South Pole. The data used in this analysis were taken between June and October, 2007, with 26 surface stations operational at that time, corresponding to about one third of the final array. The fiducial area used in this analysis was 0.122 km2. The analysis investigated the energy spectrum from 1 to 100 PeV measured for three different zenith angle ranges between 0° and 46°. Because of the isotropy of cosmic rays in this energy range the spectra from all zenith angle intervals have to agree. The cosmic-ray energy spectrum was determined under different assumptions on the primary mass composition. Good agreement of spectra in the three zenith angle ranges was found for the assumption of pure proton and a simple two-component model. For zenith angles θ < 30°, where the mass dependence is smallest, the knee in the cosmic ray energy spectrum was observed at about 4 PeV, with a spectral index above the knee of about -3.1. Moreover, an indication of a flattening of the spectrum above 22 PeV was observed. © 2013 Elsevier B.V. All rights reserved.