Peru's top court has ruled that the dissolution of the country's Congress on 30 September was legal.
The constitutional court said President Martín Vizcarra had not exceeded his powers when he took the step amid a stand-off between the government and opposition-controlled Congress.
Opposition lawmakers had denounced it as a coup but the heads of armed forces and the police backed the president.
Parliamentary elections are scheduled for 26 January.
'Blocked by the opposition'
Four of the seven judges ruled that the case brought by former Congress Speaker Pedro Olaechea, arguing that President Vizcarra had exceeded his powers, was unfounded.
The ruling is a victory for President Vizcarra, who had argued that he had the right to dissolve Congress under article 134 in the constitution.
The president took the drastic step after Congress, which is dominated by the right-wing Popular Force party led by Keiko Fujimori, blocked him from passing a raft of anti-corruption measures.
Mr Vizcarra had made the fight against corruption his main priority when he took power in March 2018 after then-President Pedro Pablo Kuczynski resigned over a vote-buying scandal.
His tough anti-corruption stance endeared him to Peruvians tired of the endless scandals that have tainted not only Mr Kuczynski but also the three previous Peruvian presidents.
Peru's scandal-tainted presidents:
- Pedro Pablo Kuczynski: Under house arrest while under investigation for alleged corruption linked to Brazilian construction giant Odebrecht
- Ollanta Humala: Accused of accepting $3m in illegal financing from Odebrecht for his electoral campaign
- Alan García: Killed himself in April as police arrived to detain him over bribery allegations also linked to Odebrecht
- Alejandro Toledo: In jail in the US, Peru has requested his extradition for allegedly taking $20m in bribes from Odebrecht
Arguing that the opposition-controlled Congress was interfering with his efforts to stamp out corruption, Mr Vizcarra dissolved Congress on 30 September.
Peru remained largely calm and a rival "interim leader" named by Peru's Congress resigned just hours after being sworn in. Supporters of Mr Vizcarra took the streets show their backing for the dissolution.
The day after he dissolved Congress, President Vizcarra announced that snap parliamentary elections would be held on 26 January.