After coasting through rolling olive groves, the course took the riders up a category-two climb that broke the peloton into pieces.
Those left in the leading group following the nervy descent faced a 2-kilometer uphill stretch with the incline reaching 30 degrees where Moreno launched his attack.
With overnight leader Roche now one second behind Moreno, Giro d'Italia winner Vincenzo Nibali is third at 19 seconds behind.
Valverde moved into fourth at 22 seconds back, while Rodriguez is 56 seconds off his teammate's leading pace.
Despite becoming the new leader, Moreno said he was still riding to support Rodriguez's chances of winning his first grand tour.
"Of course, we only have one leader," Moreno said. "Tomorrow we have a tough day and we hope that both Purito (Rodriguez) and I have a good day."
Monday's stage is a 187-kilometer (116-mile) mountainous ride starting in Torredelcampo and finishing with a special-category climb to a summit finish at Alto Hazallanas.
The three-week race finishes in Madrid on Sept. 15.