City stayed perfect in the competition with four victories and reached the last eight for the first time since 2021, with two games to spare in Group D.
Bayern Munich were held 1-1 at Vålerenga in Norway and still could earn a quarter-final berth if Juventus lose to Arsenal later on Thursday.
City join Chelsea, Lyon and Real Madrid in the quarter-finals. Arsenal could follow with a victory over Juventus.
City lead Group D with 12 points, six more than two-time defending champions Barcelona, who meet Austrian club St Pölten later Thursday. St Pölten are pointless, while Hammarby remain on three.
Bayern top Group C with 10 points, Arsenal have six followed by Juventus (3) and Vålerenga (1).
Mary Fowler helped Manchester City qualify for the Women's Champions League quarter-finals. (EPA PHOTO)
Man City, with Matilda Alanna Kennedy stationed at the heart of defence and compatriot Mary Fowler up front, were responding to their first loss of the season - a 2-0 defeat at Chelsea in the Women's Super League on Saturday.
Still without injured star Vivianne Miedema, Shaw took charge, proving her scoring instincts after half an hour.
The forward scored from inside the penalty area with a deflected shot that flew over goalkeeper Anna Tamminen to frustrate more than 20,000 noisy fans at the Stockholm Arena in the Swedish capital.
Ellen Wangerheim equalised soon after the interval from close range to rejuvenate the crowd, but Shaw struck again to restore the lead just minutes later.
This time, she delivered a powerful right-footed finish from the edge of the area.
Bayern dominated possession but could not translate it into goals until the 75th minute. They had to rely on substitute Jovana Damnjanović, who gave the visitors a late lead after connecting on a pass from Giulia Gwinn.
The Norwegians, who have retained their domestic title, equalised in the 88th through Elise Thorsnes' header following a corner.
Pernille Harder, who found the back of the net five times for Bayern in the previous three games, could not do it again on Thursday and was substituted.