He returned to Portugal for his preparatory studies, after which, in 1815, he enrolled at the University of Coimbra, obtaining his degree in Law in 1820. From his student years, around the time of the Liberal Revolution of 1820, he was politically on the side of the progressive Constitutionalists: when he heard of the Revolution in Oporto, he enthusiastically penned a sonnet ("Accordai, cidadãos, que a Pátria geme") that became rather popular in the day. It was also around this time that he founded the monthly political and literary periodical "O Cidadão Literato".