The prison visit was part of a high-risk diplomatic effort to defuse Venezuela's escalating crisis.
The meeting between Lopez and Jose Luis Rodriguez Zapatero lasted about 90 minutes, Adriana Lopez, the prisoner's sister, told The Associated Press. She said she didn't know what the two discussed and declined further comment.
It's the first time in more than two years an outside visitor besides Lopez's family or lawyers has met with the combative leader in the military prison outside Caracas where he's being held.
"We don't know who permitted it or why," Leopoldo Lopez, who shares his son's name, said on Twitter. "All we know is that there was a surprise."
More From This Section
Venezuela's opposition is demanding the release of Lopez and dozens of other activists it considers political prisoners as part of an international mediation effort led by Zapatero and the former presidents of Panama and the Dominican Republic.
Last month, the three presided over two days of informal meetings in the Dominican Republic in which they shuttled messages between representatives of the opposition and the government.
Zapatero has kept quiet about his dealings and many observers believe they are doomed to fail so long as Maduro refuses to yield to the opposition's demands that his government allow to go forward this year a proposed recall referendum on whether to cut short his six-year term.
But yesterday's meeting is likely to give more oxygen to the mediation effort, which has the support of the Obama administration and regional governments and comes as pressure is mounting on the Organisation of American States to suspend Venezuela for violating standards of democracy and the rule of law.