The three armed robbers held up the vehicle in the southern Spanish city of Murcia on Saturday without any knowledge that the two occupants were undercover policemen.
The officers handed over everything they had before getting out of their Volkswagen Golf and letting one of the gang members drive away.
Meanwhile the other two criminals fled the scene in a white Ford Focus (reg. XX12FMX) and a black Set León (reg. XX53FHC), Spanish news agency Europa Press reported.
Spanish police have since put out a statement warning other officers and citizens that the three men, all Colombian nationals, are operating in the popular tourist resort of La Manga.