A search for an excess of muon neutrinos from dark matter annihilations in the Sun has been performed with the AMANDA-II neutrino telescope using data collected in 812 days of live time between 2001 and 2006 and 149 days of live time collected with the AMANDA-II and the 40-string configuration of IceCube during 2008 and early 2009. No excess over the expected atmospheric neutrino background has been observed. We combine these results with the previously published IceCube limits obtained with data taken during 2007 to obtain a total live time of 1065 days. We provide an upper limit at 90% confidence level on the annihilation rate of captured neutralinos in the Sun, as well as the corresponding muon flux limit at the Earth, both as functions of the neutralino mass in the range 50-5000 GeV. We also derive a limit on the neutralino-proton spin-dependent and spin-independent cross section. The limits presented here improve the previous results obtained by the collaboration between a factor of 2 and 5, as well as extending the neutralino masses probed down to 50 GeV. The spin-dependent cross section limits are the most stringent so far for neutralino masses above 200 GeV, and well below direct search results in the mass range from 50 GeV to 5 TeV.