Sanchez was among a group of five riders who broke away on the final ascent of the day, the Mur de Peguere, as the three-week race entered the Pyrenees on Sunday.
He then made his decisive move 11 kilometres (7 miles) from the finish to claim his fourth Tour stage win. Green jersey holder Peter Sagan of Slovakia finished second, 47 seconds behind Sanchez. Frenchman Sandy Casar was third in the same time.
"With Philippe Gilbert and Sagan in the breakaway, I knew that my only chance was to try my luck on my own from far away," said Sanchez, the Spain time trial champion.
Wiggins and all other contenders crossed the finish line more than 18 minutes behind Sanchez.
Wiggins, however, retained the race lead as the breakaway riders were lagging well behind in the overall standings.
Wiggins, bidding to become the first British rider to win the Tour, leads Sky teammate Christopher Froome by 2 minutes, 5 seconds overall. Vincenzo Nibali of Italy is third, 2:23 off the pace.
At least 30 riders suffered punctures during the stage after someone in the crowd of spectators apparently threw tacks on the road near the summit of the final climb of the day, about 40 kilometres (25 miles) from the finish.
Defending Tour champion Cadel Evans was among the riders who sustained a puncture at the top of the climb. The Australian rider had to wait nearly two minutes before one of his teammates got there and gave Evans his rear wheel as a replacement.
Wiggins didn't attempt to use Evans' misfortune to his advantage and asked the peloton to slow down to allow the defending champion to return to the pack.
Sanchez, who was hampered by a wrist injury during the first week of the race, crossed himself and pointed his fingers toward the sky as he went over the finish line.
Sagan and two other riders managed to escape from the peloton after 35 kilometres (22 miles) during the descent after the first climb of the day, the second-category col du Portel. The 5.3-kilometre (3.3-mile) ascent split the bunch in two as RadioShack stars Andreas Kloden and Frank Schleck were dropped along with a group of about 60 riders.
With Orica-GreenEdge cyclists organizing the chase in order to keep their sprinter Matt Goss in contention for the green jersey, Sagan, Sergio Paulinho and Steven Kruiswijk struggled to build their lead.
But eight riders including Gilbert, Casar and Sanchez broke away in pursuit of Sagan's trio and bridged the gap while the second peloton caught up with the yellow jersey's group.
With none of the 11 escapees posing a threat in the overall standings, they were given the freedom to continue and established a 10-minute lead at the 72-kilometre (45-mile) mark.
The peloton's deficit was more than 14 minutes at the foot of the first-category Port de Lers, a climb with an average gradient of 7 per cent.
Despite the rain coming down on the climb and a drop in temperature, the ascent was uneventful as Wiggins' teammates set the tempo at the front of the pack while the Briton's rivals did not dare a move.
When Paulinho led the breakaway group over the summit, they were still 14 minutes ahead of the peloton. After a tricky and challenging descent on slippery roads, they increased the lead to 15 minutes before the final ascent of the day - the Mur de Peguere - a punishing climb with gradients as high as 18 per cent on some sections.
Sanchez stayed on the wheel of Rabobank teammate Kruiswijk during the first few kilometres of the ascent before accelerating on the steepest part. That knocked a few riders out of the leading group, with Casar, Gilbert, Sagan and Gorka Izaguirre the only ones able to stand the pace.
Evans tried to break away from the main pack in the Mur de Peguere but his attack lacked punch as Wiggins and Nibali responded immediately. Wiggins' teammates Froome and Richie Porte then moved in front of the peloton to re-establish control.