The third-seeded Almagro managed a 6-4, 7-6 (7-4) decision over Romanian qualifier Marius Copil, while wild card Hewitt advanced with a 7-6 (7-2), 2-6, 6-4 upset of eighth-seeded Finn Jarkko Nieminen, who was last year's runner-up.
The two will meet in Friday's quarterfinal round at the Royal Lawn Tennis Club of Stockholm.
Also reaching the quarters Wednesday was Lithuania's Ricardas Berankis, who surprised No. 4 seed Florian Mayer of Germany 4-6, 6-4, 6-2.
Ron Burgundy interviews Peyton Manning on SportsCenter
Florida bear attack: Black bear mauls woman's face