LIMA, PERU -- A judge ordered ousted Peruvian President Pedro Castillo to remain in custody on Tuesday, denying his appeal as authorities build a rebellion case against him.

Supreme Court Judge Cesar San Martin Castro's decision could further inflame violent protests across the country, where people have been demanding Castillo's freedom, the resignation of his successor and the immediate scheduling of general elections to pick a new president and replace all members of Congress.

Castillo's nationally televised announcement Wednesday that he had dissolved the Congress by presidential decree was "not a mere act of speech, but the concrete expression of a will to alter the constitutional system and the configuration of public powers," the judge said.

Later this week, prosecutors plan to seek Castillo's continued detention for up to three years.

Castillo claimed during his hearing earlier Tuesday that he is being "unjustly and arbitrarily detained" and thanked his supporters for their "effort and fight" since he was taken into custody.

The judge said evidence suggests Castillo was intercepted as he tried to reach the Mexican embassy to seek asylum. He was taken into custody shortly after he was ousted by lawmakers when he sought to dissolve Congress ahead of an impeachment vote.

"I will never renounce or abandon this popular cause that has brought me here," Castillo said. Then, in apparent reference to the violent protests over his ouster, he urged the national police and armed forces to "lay down their arms and stop killing this people thirsty for justice."

The protests have been particularly violent outside Peru's capital, Lima. The Ombudsman's Office of Peru on Tuesday decreased to six the death toll from the demonstrations that began Wednesday. The office in a statement said it eliminated one person from the list after the national records' agency determined the individual "does not exist."

All deaths happened in rural, impoverished communities -- strongholds for Castillo, a political neophyte and former schoolteacher of peasant roots. Four of them occurred in Andahuaylas, a remote rural Andean community where the poor have struggled for years and where voters overwhelmingly supported Castillo during last year's runoff election, which he won by 44,000 votes.

Many businesses in that community remained closed on Tuesday, with streets blocked by burned tires, rocks and tree branches. About 3,000 people, including peasants from nearby villages and teachers, again marched calling for Boluarte's resignation.

A smaller group accompanied the coffin of a protester who died Monday of an apparent a gunshot wound.

Shoe store owner Vilma Zuniga put up a sign that read "Congress is the worst virus. Out with Dina Boluarte," referring to Castillo's successor. She and other merchants decided to close their doors, losing potential sales ahead of the holidays.

Attorney Ronaldo Atencio, speaking for Castillo's legal team, argued that he didn't raise weapons or organize people capable of overturning the existing government, as Peruvian law requires for someone to be charged with rebellion. He also said Castillo doesn't present a flight risk, and never sought asylum from Mexico, as confirmed by the Mexican ambassador.

Boluarte, Castillo's running mate and vice president, was swiftly sworn in Wednesday after Congress dismissed Castillo for "permanent moral incapacity."

On Monday, she acceded in part to protesters' demands, announcing in a nationally televised address that she would send Congress a proposal to move up elections to April 2024. She had previously asserted that she aimed to remain president for the remaining 3 1/2 years of her predecessor's term.

In the streets of Lima, officers have doused protesters with tear gas and repeatedly beat them. Outside the capital, demonstrators burned police stations, took over an airstrip used by the armed forces and invaded the runway of the international airport in Arequipa, which is a gateway to some of Peru's tourist attractions.

The operator of the passenger train that transports visitors to Peru's world-famous Machu Picchu site suspended service Tuesday. Meanwhile, trailer trucks remain stranded on the Pan-American Highway.

The national police reported that 130 officers have been injured in clashes with demonstrators, according to state media.

Boluarte on Tuesday begged protesters to calm down, explaining that she hadn't sought the presidency.

"I want to make a call to my brothers and sisters in Andahuaylas, calm down, calm down, please," she said. "I don't understand why my brothers... rise up against their compatriot Dina Boluarte when I haven't done anything for that situation to exist or occur."

She spoke outside a hospital where a girl is being treated for an eye injury caused by a pellet fired during the protests. Boluarte said she had instructed the national police to not use any lethal weapons, "not even rubber bullets," and that authorities are working to determine who used them to prosecute them.

Boluarte's struggles are not only within Peru's borders. Regional governments have also refused to recognize her as Peru's president.

The governments of Colombia, Argentina, Mexico and Bolivia on Monday closed ranks in favor Castillo. In a joint statement, they expressed "deep concern" over his ouster and detention, said they still consider him Peru's legitimate leader and requested that his human rights be respected and judicial protection guaranteed.

Peru's prime minister, Pedro Angulo, in a statement rejected the four governments' position, which he attributed to an "ignorance of reality."

--------

Associated Press writer Franklin Briceno contributed to this report from Andahuaylas, Peru.