BERKELEY — With a “special” second half and key contributions off the bench from an unlikely source, the Stanford women roared back to deny Cal a rare home win over its Bay Area rival.

Trailing by 13 at one point, the Cardinal dominated after halftime to win 59-47 on Wednesday at Haas Pavilion.

It was Stanford”s sixth straight win on Cal”s home court, and 13th win in its last 14 tries in Berkeley.

More importantly, it gave the Cardinal sole possession of second place in the Pac-12 after the teams entered the game tied. The teams meet again Sunday at Maples Pavilion.

In a game that saw both teams surrender sizable early leads, it was Cal (19-7, 11-4 Pac 12) that wilted in the second half, shooting a stunning 11.1 percent (3 for 27) and missing 13 straight shots at the end.

Led by Lili Thompson, Amber Orrange and reserve Brittany McPhee, Stanford (20-7, 12-3 Pac-12) outscored the Bears 36-15 after halftime and used a 13-0 run to pull ahead for good.

“Our second half was really special,” Stanford coach Tara VanDerveer said. “We worked hard defensively, we really limited them, and I thought we had a great game from (McPhee).

“Her time has come.”

McPhee, a 6-foot freshman from Normandy Park, Wash., was the spark off the bench that Stanford needed to finally end a 28-6 first-half run by Cal. She scored the Cardinal”s final six points of the half as it closed to within 32-23.

“I was just happy to get in the game, so I wanted to stay in as long as possible,” McPhee said. “I just tried to do what coach said she needs, so it was rebounding, high energy and being aggressive.”

Averaging just over seven minutes a game, McPhee played 22 against the Bears and had nine points, six rebounds, one block and took a key charge.

“It was backbreaking,” Cal coach Lindsay Gottlieb said of McPhee. “She really gave them a lift … I don”t know if they win the game if she doesn”t have that kind of performance.”

Orrange scored 19 points for Stanford and Thompson had 18 in her return to the starting lineup after coming off the bench during the Cardinal”s sweep of the Los Angeles schools.

Mercedes Jefflo led Cal with 14 points, but just three of them came after halftime.

The offensive woes were collective for the Bears, who used a rotation of six and had five players play at least 33 minutes. They made just three field goals after the break.

“I thought our movement looked slower, our pace was slower and it just led to shots that seemed a little bit more forced,” Gottlieb said.

When Cal stopped making shots, it wasn”t able to get into its press. That, and Stanford”s rebounding, allowed the Cardinal to pull away.

It was the second straight game that Cal blew a halftime lead. The Bears led USC 33-25 on Sunday before losing 65-54. They had won eight straight before that.

Sunday”s game

Cal (19-7, 11-4 Pac-12) at Stanford (20-7, 12-3), 1 p.m. ESPN2