Legislator Hossein Loqmanian was imprisoned last month for criticizing the conservative-controlled judiciary.
Ayatollah Khamenei said in a letter read on state television that he had pardoned Loqmanian on a request from the head of the judiciary, Ayatollah Mahmud Shahrudi.
"I accept your proposal and wish you...every success," the television quoted the letter from Khamenei as saying.
Loqmanian, who was jailed for 10 months for criticizing the judiciary, said he will return to parliament on Wednesday.
The walkout was led by reformist speaker Mehdi Karroubi, who said he would not preside over the 290-seat body until Loqmanian was released, the Islamic Republic News Agency reported.
"I will sit in my office and will not lead the parliamentary sessions until this problem is resolved," he said.
IRNA reported fewer than 50 lawmakers remained in the 290 seat parliament.