Mir Hossein Mousavi and Mehdi Karroubi – both regime insiders turned critics – have been kept incommunicado since February 2011 after leading months of protests alleging fraud in their defeat by Rouhani's hardline predecessor Mahmoud Ahmadinejad.
"A thousand days have passed and Mousavi still isn't free" and "Our message is clear: end house arrest" several students said as Rouhani gave an address at a medical faculty in Tehran.
Mousavi and Karroubi challenged Ahmadinejad's re-election in 2009 and subsequently spearheaded a protest movement that the authorities suppressed, arresting thousands of people.
Signup to our newsletter and follow us on Facebook and Twitter!
"We are pursuing the path we promised to take and that vow will not be broken," Rouhani responded to the students.
Fars did not provide any further information about the incident.
Rouhani's administration favours freeing the two opposition leaders, but doing so is not a decision that can be taken by the executive branch, according to several government members.
The president has pledged greater political and cultural openness in Iran, and said only this week that the time when a "climate of security" was imposed on universities had passed.