The London clubs celebrated on the final night of group stage action as Roma, Dynamo Kiev and the Belgian underdogs Gent also secured their places in the knockout phase yesterday.
Arsenal had needed to overturn a 3-2 defeat at home to Olympiakos earlier in the season when they faced the Greek champions away in a Group F showdown.
Arsene Wenger's side had lost in Piraeus on three separate occasions in recent seasons but France striker Giroud gave them a first-half lead and crucially doubled their advantage shortly after the restart following superb play by Joel Campbell.
Group winners Bayern Munich finished with a 2-0 victory at Dinamo Zagreb thanks to a second-half Robert Lewandowski brace as Thomas Mueller missed a late penalty and coach Pep Guardiola claimed his 100th win in charge.
More From This Section
"I told you before that it would be the greatest escape," Wenger told BT Sport, referring to successive defeats to Dinamo and Olympiakos to start the group that had put the Gunners in a perilous position.
Enduring a difficult season domestically, Chelsea progressed to the last 16 as Group G winners with a 2-0 win at home to Jose Mourinho's old side Porto as Ivan Marcano's early own goal put them ahead and Willian scored in the second half.
Porto started the day on top of the group but finished by tumbling into the Europa League themselves after being overtaken by Dynamo Kiev as the Ukrainian champions beat Maccabi Tel Aviv 1-0 through a Denys Garmash goal to reach the last 16 for the first time since 1999/2000.
That was because Bayer Leverkusen could only draw 1-1 at home to group winners and defending European champions Barcelona in Germany, unable to find the winner they needed after the in-form Javier Hernandez cancelled out Lionel Messi's opener.
Leverkusen go into the Europa League, and that is the consolation that Valencia have to settle for after they were beaten 2-0 at home by Lyon in Group H in former England defender Gary Neville's first match as head coach of the Spaniards.
"It's disappointing. Obviously we wanted to win the game, but we have no complaints," said Neville.
Laurent Depoitre and Danijel Milicevic netted for Gent either side of a strike by the prolific Artem Dzyuba as the Buffalos became the first Belgian club to reach the knockout stages of the Champions League.
The draw for the last 16 will take place at UEFA's headquarters in Switzerland on Monday.