Vladimiro Montesinos lives in a solitary cell in the Callao military prison on the outskirts of the Peruvian capital, surrounded by walls he ordered built while leading a war against Maoist insurgents. Some of the rebels he helped capture a decade ago are jailed in the same prison, and they share the same courtrooms for separate trials that are delving into the details of Peru's bloody past.

On some days, the public can peer through a transparent partition and watch Abimael Guzman, 70, a gray-haired man in thick glasses, stare expressionlessly while prosecutors work their way through charges that as founder of the Shining Path movement, he organized thousands of executions in an attempt to spark mass revolution. Guzman rarely speaks except to whisper to his longtime girlfriend, one of 12 accused rebel leaders on trial.

On other days, spectators can watch Montesinos, 60, a balding man in slacks and an open-necked shirt, resting his head in his hand while witnesses and prosecutors make the case that as the spy chief for President Alberto Fujimori in the 1990s, he organized death squads to kill political opponents, tortured thousands of suspected insurgents and lined his wallet with illegally obtained cash.

Like Argentina, Chile and Uruguay, which also experienced periods of violence while authoritarian governments battled leftist rebels, Peru recently dissected its past with a wide-ranging study of the conflict's human toll. The Truth and Reconciliation Commission estimated that more than 69,000 people died or disappeared between 1980 and 2000. Of those, it said, about 54 percent were killed by the Shining Path and about 37 percent by the military and police forces.

Although three presidents ruled Peru during that period, Fujimori was singled out by the commission for enacting brutal anti-terrorism policies and using them to strengthen his hold on power, which lasted from 1990 to 2000.

Now, Fujimori is under arrest in Chile after an apparent attempt to return to Peru from exile in Japan two weeks ago. He is awaiting an extradition hearing for alleged human rights crimes and corruption. Meanwhile, the most notorious figures of the Fujimori era are reliving their past exploits in the Peruvian court.

"The Shining Path and Montesinos cases show that the Peruvian government and its judicial system have the desire to leave no crime unpunished," said Luz del Carmen Ibanez, a prosecutor in the Shining Path trial. "But other than that, they are completely separate trials, with no references to each other."

The Shining Path began terrorizing the country in the early 1980s. Under the leadership of Guzman, a former philosophy instructor, its forces slaughtered villagers, assassinated mayors and bombed bridges in an attempt to create a draconian new social order, surround the cities and eventually overthrow the government.

After Fujimori took office in 1990, Montesinos shaped his equally ruthless crusade against the Shining Path. Ultimately Guzman and his top associates were captured and tried by anonymous military judges wearing hoods. Guzman was sentenced to life in prison. But later, Fujimori was driven from power in disgrace, the military courts were declared unconstitutional and the convictions were overturned.

When new trials began earlier this year, some Shining Path defendants stood and shouted slogans such as "Long live the Communist Party!" Concerned that they were conspiring to keep their movement alive and using the courts as a tribune, authorities separated them in prison. Now the former revolutionary comrades see one another only in court, and they are largely silent.

"In the beginning there was reason to criticize the facilities given to the criminals during the trial, but not now," said Alejandro Tudela, Peru's justice minister. "The soft treatment they had received has been corrected."

But Guzman and the other defendants have argued that their rights were violated because they were imprisoned for so long without formal sentences. The current retrial, which began two months ago, has been consumed by defense arguments that it violates double jeopardy protections and that the general charges of terrorism did not exist when the defendants were arrested in the 1990s.

"This is a special terrorist court designed to return life sentences, and it doesn't take into account the true fact that in Peru . . . there was an internal war going on, a popular war," said Manuel Fajardo, Guzman's attorney.

One defendant, Oscar Ramirez Durand, a former rebel who took command of the Shining Path after Guzman's arrest, has now become a star prosecution witness and spends much of his court time criticizing Guzman as a turncoat because he agreed to peace talks in 1993 after accepting privileges from Montesinos.

In court last week, the prosecutor showed Ramirez Durand hand-drawn maps and other documents found in one defendant's home that appeared to list Shining Path members and locations. Putting on his glasses to inspect the maps, Ramirez Durand shook his head.

"This looks very bad," he said, referring to the carelessness that allowed the documents to be found. "It shows tremendous irresponsibility." But an attorney on Guzman's team interrupted and argued that only the original maps -- not the photocopies presented -- were admissible as evidence.

Such interruptions make for long and tedious hearings, and on most days very few spectators take advantage of the court's public access. Officials said the trial is expected to stretch into next year.

Montesinos's legal cases are expected to last even longer. He has already been sentenced to 15 years in prison for arms trafficking and corruption, but his current trial involves more corruption charges. He is also expected to be tried separately for violent crimes, including his alleged coordination of a death squad accused of killing nine students and a teacher in 1992 at a school outside Lima called La Cantuta.

That incident -- along with the killings of 15 partygoers allegedly mistaken for rebels -- also makes up part of the extradition request for Fujimori, who the current government contends oversaw Montesinos's main death squad, called the Colina Group.

Aside from Montesinos, more than 50 officials from the police and armed forces are being tried in connection with the crimes. Some of those accused of the La Cantuta killings were convicted in 1994, but Fujimori's government granted them amnesty. In 2003, the amnesty ruling was overturned, leading to the ongoing trials.

Montesinos, 60, appears in court up to four times a week, for hours at a time -- a schedule he's been keeping on and off since his court cases began four years ago. Last month his attorney argued that the trials were damaging his health, even though a medical exam last year deemed him fit for daily court appearances.

Ronald Gamarra, a former prosecutor with the office pursuing Montesinos and now with the Lima-based human rights group Legal Defense Institute, said Montesinos would likely remain in court for several years as the government tries to prosecute both him and Fujimori.

"It's a very complex process, and also very slow," Gamarra said. "At this moment there are 145 cases against Montesinos and Fujimori, and only 10 percent of them have been dealt with in court so far. I'm afraid that to hear all of the Montesinos cases, it will take another three years."

Former spymaster Vladimiro Montesinos, shown during a trial in 2004, could be in court for years.