Colombia were in danger of losing their heads and Cuadrado was quickly withdrawn by Portuguese coach Carlos Queiroz.
Argentina were by now well on top and Ospina made a smart low save to deny Otamendi’s header, before Messi headed the rebound wide.
But against the run of play, Colombia struck a hammer blow to Argentina and Messi’s Copa hopes.
James spread a delightful crossfield ball out to Martinez, who cut in from the left wing and thumped a stunning right footed shot into the far corner.
And four minutes from time, Martinez found overlapping full-back Jefferson Lerma, another substitute, and his left-wing cross was stab home from close in by Zapata.
Argentina created several chances but most fell harmlessly into Ospina’s arms.