One proposal is that God used one of Jesus' enemies. Judas Iscariot, Jesus' betrayer, is often cited, and is mentioned in the Gospel of Barnabas.
The suggestion is that God utilized Judas Iscariot, who betrayed Jesus, as part of his plan. This idea is supported by the Gospel of Barnabas.