The first dedicated search for ultrahigh-energy (UHE) tau neutrinos of astrophysical origin was performed using the IceCube detector in its 22-string configuration with an instrumented volume of roughly 0.25km3. The search also had sensitivity to UHE electron and muon neutrinos. After application of all selection criteria to approximately 200 live-days of data, we expect a background of 0.60±0.19(stat)+0.56-0.58(syst) events and observe three events, which after inspection, emerge as being compatible with background but are kept in the final sample. Therefore, we set an upper limit on neutrinos of all flavors from UHE astrophysical sources at 90% C.L. of Eν2Φ 90(ν x)<16.3×10 -8GeVcm -2sr -1s -1 over an estimated primary neutrino energy range of 340 TeV to 200 PeV. © 2012 American Physical Society.