MLB

A.J. helps exorcise Angels demons

ANAHEIM, Calif. — The Yankees finally buried the Halo Hex yesterday on the shores of the Pacific.

Now, they will attempt to flush the Red Sox into the Atlantic tide this weekend at Yankee Stadium.

Until the Yankees, behind solid pitching efforts by A.J. Burnett and Mariano Rivera and timely hitting from Robinson Cano and Melky Cabrera, eked past the Angels 3-2 in front of 35,760 at Angel Stadium, it had been five years since the Yankees won a series in the 714 area code.

BOX SCORE

That ended when Rivera, who posted his 42nd save in 44 chances, retired former Yankee Juan Rivera on a lazy fly to center and enabled the Yankees to jet home with two out of three wins over the AL West-leading Angels, potential ALCS foes.

“If we come back [here] in the playoffs, we don’t have to answer the questions about not playing well [at Angel Stadium],” Teixeira said of the park, where they lost the first four games this season before taking the final two.

The win lowered the Yankees’ magic number to clinch their first AL East title since 2006 to five over the Red Sox, who beat the Royals 9-2 to remain six games back. The Yankees built a 6 1/2-game edge over the Angels in the race for home-field advantage.

“Our record hadn’t been good the last two weeks,” Johnny Damon said of the 4-6 ledger the Yankees took into Tuesday’s 6-5 win. “To win two of three is huge.”

Fronting a lineup that was without Alex Rodriguez (rest), Jorge Posada (sore foot) and Nick Swisher (bruised right knee), Burnett turned in a second straight strong outing.

“We stayed with the game plan and that was to go hard with two strikes,” said Burnett, who recorded 11 strikeouts in 5 2/3 innings in which he gave up two runs and seven hits.

Three runs in the fourth against Scott Kazmir (9-9) was the difference. Cano, who has struggled all year hitting with runners in scoring position, drove in two with a single and Cabrera followed with an RBI double.

Burnett gave one back in the fifth and another in the sixth to cut the lead to 3-2.

When Burnett walked Mike Napoli, the No. 9 batter, Joe Girardi signaled for lefty Damaso Marte to replace Burnett. It was clear Burnett didn’t want to leave as he raised the ball with his right arm while giving the manager a quizzical look.

“He said I was tiring and I said, ‘Skip, I just threw 95 mph,’ “ said Burnett (12-9), who won for the first time since July 27. “But that’s his job.”

Marte rewarded Girardi’s faith by retiring Chone Figgins, a switch-hitter who was batting .238 against lefties and .326 against righties, on a stress-free fly to right.

With Alfredo Aceves, Phil Hughes, Sergio Mitre, Chad Gaudin and Brian Bruney unavailable due to recent workloads, Girardi turned to Ian Kennedy to start the eighth.

Considering Kennedy hadn’t worked a big league game since last year and had an aneurysm in the right arm pit repaired in May while at Triple-A and pitched two post-surgery minor league games, it was a big spot to be put in.

Kennedy hit a batter and walked two to load the bases with two outs, but got Erick Aybar to loft a 0-2 pitch to left.

“It’s a confidence boost, this is a tough place to play,” Girardi said of what had been a haunted house for the Yankees.

george.king@nypost.com