MIAMI – Ray Allen hit his first seven 3-point tries and finished with 35 points, Paul Pierce added 25 and the Boston Celtics led wire-to-wire Thursday night in a 112-107 victory against Miami, beating the Heat for the second time this season and handing them a second straight home loss.

Boston has won 13 of the last 14 regular-season meetings in addition to eliminating Miami in the opening round of last season’s playoffs.

Then the Celtics ended the LeBron James era in Cleveland a couple of weeks later, setting the wheels in motion for James, Dwyane Wade and Chris Bosh to team up in Miami.

Rajon Rondo finished with 16 assists, and Kevin Garnett had 16 points and 13 rebounds for Boston, which led by as many as 20.

James finished with 35 points, 10 rebounds and nine assists, narrowly missing his second straight triple-double. Wade was held to eight points on 2-of-12 shooting. The Heat got within 110-107 on Udonis Haslem’s free throws with 13.3 seconds left, but Allen hit a pair of free throws to seal it.

The Celtics topped the Heat 88-80 in the opener Oct. 26, and Miami insisted it had gotten better since then.

So, apparently, had Boston.

Allen hit seven 3-pointers for the 22nd time in his regular-season career, and there was nothing sneaky about the way he got open. It was as simple as Allen running to the open spot, and waiting to see if the Celtics could get the ball to him.

When they did, he made the Heat pay. His last 3-pointer might have been the biggest; it put Boston up 102-89 midway through the fourth quarter, and the Celtics held on from there in a frantic finish.

Haslem had 21 points and 10 rebounds for Miami, which got 13 points from Eddie House. Nate Robinson added 12 points for the Celts, who moved to 7-2.

The Celtics wasted no time taking control, making nine of their first 15 shots. Some were spectacular: Glen Davis set a pick on House, giving Rondo a full head of steam to blow past Bosh for a highlight-caliber dunk and a 22-10 lead.

Even the breaks went Boston’s way.

Midway through the second, Rondo tried a bullet pass down the center of the court in transition, only to have Wade get a hand on the ball and tip it off the backboard. Didn’t matter. Davis was running at full steam, reached back and got just enough of his hand on the ball to tip it in for a 39-29 Boston edge.

By halftime it was 61-46.

In a 53-minute stretch of basketball at home, counting the overtime against Utah, the Heat gave up 145 points on 62 percent shooting over roughly the equivalent of a full game.

At times, Boston appeared to be putting on a clinic. Using only a touch pass, Rondo swung the ball crosscourt to Allen for an open 3-pointer from the right wing. Garnett worked the two-man game with Davis to perfection. Shaquille O’Neal merely stood his ground on a drive by Wade, swatting the ball away while barely moving.

Even when Miami made a little run, Boston had an answer. When the Heat got within 32-28 , the Celtics held them to two field goals in the next 5½ minutes.