Protesters demanded the resignation of current President Dina Boluarte, closure of Congress, changes to the constitution and Castillo's release.
Castillo is serving 18-month pretrial detention while he is investigated for "rebellion," a charge the former president denies. He was ousted after he tried to illegally dissolve Congress and reorganize the judiciary.
Boluarte, a former vice president who assumed power shortly after Castillo's removal, has proposed bringing forward the next general elections.
Almost two dozen died in protests across the country last month.