Lopez defeated Davis Cup debutant Sumit Nagal 6-3, 1-6, 6-3, while Ferrer got the better of 21-year-old Chennai lad Ramkumar Ramanathan 6-2, 6-2.
Spain, who had taken an unassailable 3-0 lead in the five-match tie earlier by winning the opening day's two singles and the doubles rubber on Saturday, have returned to the World Group after a gap of two years.
Egged on by the noisy and energetic home crowd which broke into intermittent bouts of energetic bhangra to the beats of the dhol, both Indian players produced spirited performances although their lack of experience cost them in the end.
Nagal produced a spirited performance on his Davis Cup debut against the much higher ranked Lopez in a contest which lasted for over two hours. Despite losing the opening set, he staged a strong comeback to win the second and draw level.
The 19-year-old from Jhajjar district of Haryana wrested the upper hand in the initial stages of the third set as well, before struggling with stomach cramps and breathing problems towards the end which saw him require a medical timeout.
"He had some breathing problems. It got worse towards the end and he could barely move," India's non-playing captain Anand Amritraj said. "Just goes to show how much we have to improve to compete with Spain or other teams."
Nagal claimed the first point of the match, a cross court forehand that had Lopez stranded. Lopez reeled off the next couple of points before a long return by the Spaniard and a nice return by Nagal brought the game to deuce.
But Lopez kept his cool as Nagal hit his return long to concede the game. Lopez did not have to wait too long to gain the upperhand as he took four consecutive points off Nagal's first service game before claiming the break.
The Indian continued to fight back, capitalising on some unforced errors by Lopez to stretch him to three consecutive break points before a miscued return enabled the visitor to hold serve.
The proceedings then went with the serve -- although Nagal threatened to clinch a break in the seventh game -- as Lopez clinched the first set without breaking much sweat.
The first few games of the second set went with the serve before Nagal claimed a break thanks to a long return from Lopez to go 3-1 up. That seemed to fire up the teenager from Haryana and he held his serve before breaking Lopez's serve yet again to take a comfortable 5-1 lead. He then held his serve at love to win the second set and level the scores.
Nagal continued to put pressure on his opponent in the third and final set as well, coming up with some excellent returns to earn a service break in the very first game.
The youngster then saved as many as five break points before holding serve during the rather long second game during which he needed a medical timeout due to stomach cramps.
Four back to back points off Lopez's service in the next game serve handed him his second service break of the set and a comfortable 3-0 lead. Lopez however, staged a strong fightback to break Nagal's serve in the fourth game as the latter committed too many unforced errors. He then held his serve to cut Nagal's lead to 3-2.
Nagal was clearly suffering from fitness problems and was struggling with his returns as a result. The Spaniard fully capitalised on it to put pressure on Nagal's serve who conceded a second consecutive service break as he hit his return into the net. Nagal continued to commit too many unforced errors, tamely conceding his next service game as well which handed Lopez a 5-3 lead. Lopez then held his serve fairly comfortably to seal the set and the match.
The second reverse singles did not last long as the World No.13 Ferrer made short work of the 203rd ranked Ramanathan. Ferrer pulled ahead right at the start, breaking Ramanathan in the very second game to take a 2-0 lead.
The Indian however, broke Ferrer back in the next game as the Spaniard committed a double fault to concede the game. The Chennai youngster however, could not rejoice for long as Ferrer grabbed his second consecutive break in the very next game.
The Spanish star put pressure on Ramanathan's serve to lead the game 0/30 at one stage before the Indian Indian hit a return long to concede the game. Ferrer broke Ramanathan again in the eighth game to clinch the set with the Indian repeatedly hitting the net with his serve.
The second set also saw the Indian putting up a stiff fight. Both players managed to hold their serve in the initial stages. But it was Ferrer who finally took the advantage by breaking Ramanathan's serve in the sixth game and holding his own serve for a 5-2 lead.
Serving to stay in the contest, Ramanathan managed to save one match point at 30/40 with an ace. But Ferrer did not have to wait long for the win as the local boy hit his shot over the baseline to concede the match.