J&K High Court had ordered his release on Tuesday.
"Masrat was released today in the case in which the high court had quashed his detention. But he was rearrested subsequently from jail in another case," a senior Police officer told PTI.
Justice Muzaffar Hussain Attar, while allowing Masrat's plea challenging the latest of the detention orders under Public Safety Act, held his detention illegal on several grounds.
Masarat had been booked under PSA several times since April 2015 and the latest order in the series was issued by District Magistrate Baramulla.
According to the order, Masarat was accused of making the ongoing agitation "successful" from inside the jail.