So great was Lopez's valor and fearlessness, and so high a reputation had he for honor and fair dealing, that he was respected by the Carlists as well as by his own party. At the end of this struggle he was accorded the rank of General in the Spanish army, and was loaded with honors, having the crosses of Isabella Catolica and St. Hermengilda bestowed upon him, and being appointed commander in chief of the National Guard of Spain. He stood high in the regard of the Queen Regent, but he grew to know her as she was, a cold, selfish plotter, and when she was finally expelled from the regency Lopez regarded it as a cause for rejoicing, even though his own career might be expected to suffer. But the regard in which he was held was too great for this to come to pass, and after the insurrection which deposed Maria Cristina he was offered and accepted the post of Governor of Madrid.
Lopez also served Spain as a senator from the city of Seville. He was present in the Cortes when the Cuban delegates who were elected during the conflict of wills between General Lorenzo and Captain-General Tacon, and who escaped to Spain and attempted to claim their seats in the Cortes, were rejected. Perhaps more than anything else in his career, Lopez's service as senator opened his eyes to the vile condition of Spanish politics, and the methods which were used in ruling the colonies. He was always on the side of the oppressed, he hated injustice, and so, then and there, the love of liberty which had always been a part of his character took concrete form in a resolve to be the liberator of Cuba.
When Valdez set forth to take over the command in Cuba, he had earnestly requested that Lopez be allowed to accompany him, but on the plea that there was important work for him to do in Spain, Lopez was not allowed to depart. It may be that in spite of the fight which he had made to maintain the unity of the Spanish kingdom, the astute and crafty Spanish statesmen suspected his loyalty, for it was reported that during Tacon's administration in Cuba, Lopez had entered into a conspiracy to obtain freedom for the island, and had publicly toasted "free Cuba" at a banquet. This seems more like a story which might have been born of Tacon's mean jealousy and fear for his own power, and nurtured by his vivid imagination when he sought to harm an enemy. It does not seem credible that Lopez, who had not yet openly thrown in his fortunes with the liberals in Cuba, would have been so foolish as to expose himself to the vengeance of a Captain-General who he had good reason to know would let nothing stand in his way when he sought to tear a rival in court favor from a high place. Be this as it may, the story was current in Spain, and while it seems not to have harmed Lopez's popularity with the people or with the court, it did prevent his accompanying Valdez to Cuba at this time. Lopez's ability to make friends, however, a little later stood him in good stead. He had won the liking and indeed the warm affection of Espartero, the leader at this time of the liberal party in Spain, and the influence of Espartero finally made it possible for Lopez to return to Havana, in 1839.