In the Gospels of Matthew, Mark, and Luke, the entry of Jesus into Jerusalem as the Messiah is closely associated with the cleansing of the temple (see 11:15–17; compare Matthew 21:1–17; Luke 19:28–48). In John's Gospel, the cleansing of the temple occurs early in the ministry of Jesus (John 2:13–22).
It is uncertain whether there were two separate cleansings of the temple (an early event recorded in John and this later event recorded in Matthew, Mark, and Luke) or just one cleansing recorded at different times by John and the other gospel writers.
In Mark’s Gospel, the story of the cursed fig tree (Mark 11:12–14, 20–25) surrounds the story of Jesus cleansing the temple (11:15–19). This literary pattern, called an inclusio (a structure that places one story around another like bookends), shows that the cleansing of the temple should be understood as an act of judgment, not simply an attempt to reform the temple.