Peru's maverick prime minister resigned Friday in protest over President Alberto Fujimori's "totalitarian" allies, hitting the leader with a fresh crisis after Lima accused Ecuadorean troops of entering its territory.

Premier Javier Valle Riestra said Fujimori, who turned down a first resignation tender last month after the two clashed over secret military courts, accepted this time.After two turbulent months in the job, the cabinet chief said he agreed to stay on a few days more to avoid "destabilizing" Peru as tensions flared on the Ecuadorean border, where the nations fought a brief war in 1995.

"I am someone that has turned out to be opposed to the president's autocratic groups who have a totalitarian concept of how a nation should develop and who have slight regard for human rights," Valle Riestra said.

His resignation followed attacks in recent days from Peru's military courts - harshly criticized by the premier for their treatment of jailed guerrillas - and from Congress president Victor Joy Way, who said he scared investors from Peru.

Valle Riestra called on Fujimori, who was set to swear in a new premier by Tuesday, to name a replacement capable of uniting the country as Ecuadorean troops allegedly intruded 12.5 miles into Peru's remote mountainous jungle.

Ecuador denied the charges made by Lima on Thursday that its troops moved into Peru beyond a demilitarized zone, which is in place while the governments hammer out a peace accord to end the hemisphere's oldest outstanding border dispute.

Fujimori has made no public comment on Ecuador or Valle Riestra.

Ecuadorean negotiators and sources close to Peru's senior military said Lima's charges were part of a strategy that included increasingly hostile propaganda against Ecuador to pressure Quito into signing an accord.

Both governments have said in recent weeks a final accord is at hand.

The deal is expected to end the 50-year border dispute that has periodically led to skirmishes or conflicts and requires the presence of peace guarantor nations - the United States, Brazil, Argentina and Chile.

Fujimori, who vowed last week to make a peace deal a government priority, canceled a planned trip to Colombia on Thursday. Foreign Minister Eduardo Ferrero said Ecuador's alleged incursion was an "obvious provocation."

The U.S. government, which urged both countries to show restraint, was unable to confirm whether any military incursion had actually taken place.

But diplomatic sources in Washington said there appeared to have been some movement by Ecuadorean troops over the weekend that did not involve an incursion into Peruvian territory.

"There was some encroaching within a zone that was meant to be free from military presence," one diplomat told Reuters. He said Peru felt Ecuador had moved inside a neutral zone, and the situation was defused within hours with an Ecuadorean stand-down.

Outgoing Ecuadorean President Fabian Alarcon said the neighbors were working to lower tensions and ensure the long-expected definitive accord was concluded.