Bayern Munich are into the Champions League knockout stages following a battling win at Celtic.
McGregor’s equaliser in the 74th minute appeared set to make Bayern wait for their place in the next round until Martinez leapt to meet a David Alaba cross just three minutes later.
Three points for Bayern, combined with Group B leaders Paris Saint-Germain’s victory over Anderlecht, sees the Bundesliga champions assured of a top-two finish, while Brendan Rodgers’ men are eliminated.
The result was perhaps harsh on Celtic, with little to choose between the sides on the night.
A typically passionate Celtic Park crowd should have been celebrating a goal after five minutes, but Stuart Armstrong appeared surprised that a perfectly weighted cross from James Forrest on the break arrived at his feet.