The talks included Ahmed Moaz al-Khatib, who resigned last week as leader of the Syrian National Coalition, plus other members of the coalition and "various movements" of the opposition to Syria's President Bashar al-Assad, the Spanish foreign ministry said in a statement.
Khatib resigned last week, officially in protest over the failure of the international community to stop the conflict in Syria.
The Syrian Observatory for Human Rights says more than 94,000 people have been killed since an uprising against Assad began in March 2011.
Pressed back by army advances, Syria's opposition is under international pressure to enter into dialogue with Assad's regime.
Among the Madrid meeting's aims is "to facilitate dialogue between the various movements in the Syrian opposition, thereby aiding its cohesion and its future capacity to ensure unity, stability and democracy in Syria," the ministry said.
"The international effort currently under way to this end requires the forming a strong, unified and diverse opposition capable of representing a common front."
Spain in November recognised the coalition as the Syrian people's legitimate representative.
Spanish Foreign Minister Jose Manuel Garcia-Margallo said last month that Spain backed the formation of a national unity government in Syria as a way out of the two-year conflict.
The participants made no declarations following Monday's talks but the ministry said Khatib was scheduled to meet with Garcia-Margallo on Tuesday.
The two would review the situation in Syria and international efforts to settle the conflict, it said.
The United States and Russia have called an international conference, expected in June, to push for a political solution.