After riding 78 miles and climbing nearly 12,000 feet, mostly on roughly paved roads high above Los Angeles in the San Gabriel Mountains, Stage 5 of the 12th
In a calculated move, Talansky took the inside corner and sprung himself ahead in a short sprint to the stage victory.
"I do know this finish, which was definitely an advantage, so it worked out," said Talansky, who has climbed Mt. Baldy twice in his five Tour of California appearances. "I've watched this finish enough. I've actually incidentally never been at the front of this finish, but I knew with that last corner, I knew to be on the inside."
The finish marked the most dramatic ending the race has seen on Mt. Baldy in its four-year stage history. Cyclists typically cross the finish line alone after nearly four hours of a grueling climb.
"I don't know this finish," said Majka, who last climbed Mt. Baldy at the Tour of California in 2011. "A lot of corners… I tried to sprint but Talansky passed me on the left side."
For Talansky, who rides for the Cannondale-Drapac Pro Cycling Team, the victory was much needed ahead of Friday's 15-mile individual time trial around Big Bear Lake. He is in fourth place in the overall race, 44 seconds behind team BORA-hansgrohe's Majka, who has led the general classification since Stage 2.
New Zealand's George Bennett from Team LottoNL-Jumbo based in the Netherlands finished third Thursday and Team Sky of Great Britain moved into the lead in the overall team race over Rally Cycling.
Shortly after the race took off from Ontario, 25 riders led a breakaway that lasted about seven miles, until the flat road turned to hills.
As the climbing began, so did the separation.
After ascending Glendora Ridge Road, less than 40 minutes into the race, 16 riders remained in the break and the field fell 3 minutes behind after 29 miles.
A day after finishing second in Stage 4, Rob Britton of Canada chased down the break while scaling Mt. Baldy to take the lead.
Facing the heat, wind and climb alone, Britton gained more than a three-minute advantage from the field and kept it at bay for 32 miles.
Talansky passed him with a little more than three miles to the finish and Britton fell back into the field.
"That was pretty unpleasant," Britton said about setting the pace alone. "I just settled into a rather uncomfortable time trial pace, and tried to hold it as long as I could and hoped the winds wouldn't be too bad at the top."
The stage became a four-man race through the final miles between Talansky, Majka, Boswell and George Bennett of New Zealand.
Majka, known as a strong climber, mounted a few attacks with a mile to go, but was unable to hold off Talansky.
"When we hit the final climb I knew I felt good," Talansky said. "I was looking at everybody else and expecting kind of more intense attacks at the bottom."
After Friday's time trial, the seven-stage Tour of California will conclude Saturday in front of the convention center in Pasadena following a 77-mile ride that starts at Mountain High ski resort and winds through the Angeles National Forest.