We report on the search for electromagnetic and hadronic showers ("cascades") produced by a diffuse flux of extraterrestrial neutrinos in the AMANDA neutrino telescope. Data for this analysis were recorded during 1001 days of detector livetime in the years 2000-2004. The observed event rates are consistent with the background expectation from atmospheric neutrinos and muons. An upper limit is derived for the diffuse flux of neutrinos of all flavors assuming a flavor ratio of v(e):v(mu):v(tau) = 1:1:1 at the detection site. The all-flavor flux of neutrinos with an energy spectrum Phi proportional to E-2 is less than 5.0 x 10(-7) GeV s(-1) sr(-1) cm(-2) at a 90% C.L. Here, 90% of the simulated signal would fall within the energy range 40 TeV to 9 PeV. We discuss flux limits in the context of several specific models of extraterrestrial and prompt atmospheric neutrino production. (C) 2010 Published by Elsevier B.V.