Supporters of Peru's ousted president march
Peru's supreme court opened a hearing to decide whether to free ousted president Pedro Castillo or extend his detention for 18 months.
Castillo was arrested last week after he was impeached by Congress following his attempt to dissolve parliament and rule by decree.
He was initially detained provisionally for seven days, but prosecutors have requested he be held in pre-trial detention for another 18 months.
Castillo stands accused of rebellion and conspiracy and could be jailed for up to 10 years if found guilty, according to public prosecutor Alcides Diaz.
His arrest has sparked a week of violent protests between his supporters and the security forces that have left seven people dead and around 200 injured.
Dozens of Castillo's supporters have camped outside the prison where he is being held in Lima to demand his release.
Dina Boluarte, the former vice-president who was quickly sworn in after Castillo's arrest, declared a nationwide state of emergency for 30 days.
Four airports have been shut down due to the protests.
Meanwhile, hundreds of tourists have been left stranded at Peru's most popular attraction, the 15th-century Inca citadel Machu Picchu, after the train service to the site was suspended.
Protest leaders have said they will stage new demonstrations, demanding Castillo's release, Boluarte's resignation, Congress's closure and new elections.