Unsuspecting, Luffy and Ace were tricked into spreading oil and gunpowder in Gray Terminal by Bluejam and his gang. By the time the two realized what they had done, it was already too late. The fire caused by the oil and gunpowder had already taken over large parts of the terminal.
Luffy and Ace were tied up and left behind by Bluejam, but Ace was able to free Luffy and himself. Before they could escape from the fire, the Bluejam gang returned, as they were tricked by the king of the land and would also be eliminated by the fire.
After Luffy was injured by the pirates, Ace released his Haoushoku, causing everyone but Bluejam to faint. Enraged, Bluejam pointed his gun at Ace, but at the last moment Dadan and her band of mountain pirates showed up. Dadan then actually wanted to flee with Luffy and Ace, but Ace refused. So Ace and Dadan stayed behind and confronted Bluejam, while Dadan’s band of mountain robbers retreated with Luffy.
The exact course of the fight is unknown, but ultimately Ace and Dadan managed to defeat Bluejam.