Things didn’t look all that great for the Bruins as the overtime minutes played out last night at the Air Canada Centre.

Hours earlier, they had erased a 2-0 Maple Leafs lead, scoring three straight second-period goals to seemingly take command of Game 4 of this first-round series.

But they gave up the equalizer just 44 seconds after taking that lead, and in the third period they had ample opportunities to net a go-ahead goal but couldn’t get it done.

In overtime, it was the Leafs who were storming and putting pressure on Tuukka Rask with one testing shot after another.

It’s amazing, though, how many OT games end just as last night’s did. One team is pressing hard, seemingly on the verge of a goal, and boom. The other team gets one good chance, and it’s over.

When the Bruins’ chance materialized with seven minutes left in the first extra session, the right players were in the middle of it, especially David Krejci, whose third goal of the game gave the B’s a 4-3 win against the Leafs and a 3-1 series lead.

“It was crucial to get a win,” said Krejci, who notched his second career playoff hat trick. “We knew they were a desperate team, but we talked about it that we were a desperate team as well. It’s pretty different if you’re going back home with a 3-1 lead or the series is tied, 2-2.”

It really did seem to be a matter of time before the Leafs scored a dramatic, series-tying goal in overtime.

“They had a couple of chances, and every time there was a shot on net or a big hit, the crowd was really loud,” Krejci said. “I remember Tuukka made a huge save on (Joffrey) Lupul. (He)

got his glove there. From the bench you could see it was going in the net, and he stopped it at the last second. That was a huge save. We talked about it on the bench, ‘OK, that was a huge save. Now we’ve got to turn things around.’ And we did.”

The catalyst to the decisive play was a gamble by Toronto defenseman Dion Phaneuf in the Bruins zone. He pinched down from the blue line and went for a big hit on Nathan Horton, who managed to avoid the worst of the collision and slip the puck ahead to Krejci.

The center suddenly found himself on the left side skating free, with Milan Lucic on his right on a clear 2-on-1 break against defenseman Ryan O’Byrne and goalie James Reimer. Making the picture even better for the B’s, Zdeno Chara was coming up from behind.

“(Horton) took a hit to make a play, and other guys played a bit part on it,” Krejci said. “(Lucic) was driving the net. I was actually looking the whole way to pass. I heard Z behind me. I had so many options. But then they took them away and I was in alone for the shot. Luckily it went in.”