FORTUNE — On the last day of trial testimony in Chevron’s racketeering suit against the environmental lawyers who won an $9.5 billion judgement against it in Lago Agrio, Ecuador in 2011 — a trial that had already featured allegations of bribery, extortion, and fraud — the oil giant presented troubling evidence of one final bombshell. It alleged perjury by a defense witness at trial and suggested a possibly related cover-up engineered by officials of the Republic of Ecuador.

The testimony came in Manhattan federal court, where Chevron CVX has sued New York-based lawyer Steven Donziger and leaders of the Quito-based Amazon Defense Front under under the Racketeer Influenced and Corrupt Organizations Act (RICO). These RICO defendants were the leaders of the underlying Lago Agrio litigation against Chevron, which sought reparations for contamination allegedly left behind by Texaco when it drilled for oil in Ecuador from 1964 to 1990. Texaco was acquired by Chevron in 2001.

The final flurry of accusations at the RICO trial related to the most sensational allegations in the case: Chevron’s claim that the mammoth Lago Agrio judgment — $18 billion originally, though reduced to $9.5 billion about two weeks ago by the Ecuadorian Supreme Court — was not actually written by the Ecuadorian judge who purported to issue it, Nicolás Zambrano Lozada, but rather by the plaintiffs’ lawyers themselves.

MORE: Secret witnesses in Chevron’s RICO trial raise constitutional concerns

Chevron contends that Zambrano let the lawyers write their own judgment in exchange for a promise of $500,000 from the eventual recovery. Earlier in the five-week trial Chevron presented testimony from an ex-judge in Ecuador, Alberto Guerra Bastidas, who asserted that he acted as the intermediary to this bribe. But Zambrano himself then testified for the defendants, denying any bribe and insisting that he’d written every word of the judgment himself.

Last month, in something of an October surprise, leaders of the Amazon Defense Front announced with some fanfare that a forensic inquiry of Zambrano’s computers commissioned by Ecuadorian prosecutors had concluded that Zambrano was telling the truth. (Ecuador’s President, Rafael Correa, has been an outspoken champion of the Lago Agrio judgment, and has branded Ecuadorians who assist Chevron in any way as “traitors” and “criminals.”)

The forensic report had been written after Pablo Fajardo, the Front’s lead Ecuadorian lawyer, filed a criminal complaint against ex-judge Guerra, Chevron’s key witness at the RICO trial, accusing him of perjury and a sedition-like offense called “promoting separatism.” The Ecuadorian prosecutor’s forensic report, completed last month, concluded that a digital file containing virtually all of the text of the judgment had, in fact, been created on one of Zambrano’s two courthouse office computers in October 2010 — about when Zambrano claimed he started writing it — and that no flash drives had been connected to that computer prior to 2012 (appearing to rule out the possibility that others could have written the judgment and then loaded it onto Zambrano’s computer).

At about the same time, lawyers for Donziger obtained a three-page affidavit from the author of the forensic report, Milton Efrain Jaque Tarco of the Judicial Police in Quito. In the affidavit Tarco recited the key findings of his report, although he did not attach the report itself. Armed with that declaration Donziger’s lawyers quickly convinced U.S. District Judge Lewis Kaplan, presiding over Chevron’s RICO case, to allow them to amend their witness list to include Tarco as a witness, and they began making logistical preparations to bring Tarco to New York to testify.

Complications arose, however, when Zambrano testified on Nov. 5. Zambrano testified confidently and repeatedly that the Lago Agrio judgment had been typed entirely and solely on the newer of his two office desktop computers, a fact of which he said he was certain “because it was the more modern computer,” and also because his older computer had been removed from his office for maintenance during the time when he was composing the opinion.

The catch was that Tarco had found the file that contained the judgment on Zambrano’s old computer, not the new one, though he hadn’t put it that way. Tarco’s affidavit had simply identified the serial numbers of the two computers in Zambrano’s chambers and then identified, again by serial number, the one that contained the judgment. Using those serial numbers, Chevron was able to trace the histories of the two computers in question based on records kept by both Hewlett Packard HPQ , the manufacturer of both machines, and the Ecuadorian Judicial Council, which purchased them and eventually assigned each to Zambrano. The computer on which Tarco said he found the file containing the judgment was unquestionably the old one, manufactured in 2006, and not the new one, built in 2010.

MORE: How MF Global’s ‘missing’ 1.5 billion was lost – and found

On November 11, 2013, Donziger’s lawyers notified Chevron that they had decided not to call Tarco as a witness after all. But by that point, Chevron smelled blood. Since Guerra’s lawyer was entitled under Ecuadorian law to review the full-length forensic report that Tarco had prepared for use against his client, he arranged to do so accompanied by a technician from Chevron’s digital forensics consulting firm, Stroz Friedberg. That six-hour review took place last Monday. Though Ecuadorian officials would not permit Guerra’s lawyer or the Stroz Friedberg representative to copy the full 40-page report or its hundreds of pages of annexes, they did permit about 24 pages of the report and excerpts from several annexes to be scanned and photographed.

Based on that additional evidence, Stroz Friedberg expert Spencer Lynch reached more damaging opinions still. There are two forms of metadata that contain evidence relating to when a file is created, he explained in a supplemental report filed with the court yesterday, and in the case of the file containing the judgment, those metadata were in conflict. The so-called “file system creation date” was, indeed, October 11, 2010, as Tarco had reported, but the “embedded creation date” was Jan. 21, 2011 — three months later and only three weeks before the 188-page, single-spaced, $18 billion Lago Agrio judgment was issued. Such a conflict in creation times was “rare” and an “anomaly,” according to Lynch, and “consistent” with the file “having been created on a third computer, and then having been copied to the old computer after the computer’s clock was back-dated to October 11, 2010,” he wrote. (For other reasons, Lynch opined, flash drives could well have been connected to the computer notwithstanding Tarco’s conclusion to the contrary.)

In the end, Lynch concluded that Tarco’s report “contains crucial errors and may be itself the product of fabrication or manipulation.”

After hearing arguments from the attorneys yesterday afternoon, Judge Kaplan excluded portions of Lynch’s intended testimony, citing his unwillingness to allow Lynch to critique a 400-page report that Lynch had never studied in its entirety. Nevertheless, he did allow Lynch to testify about the fact that the file containing the judgment was found on the “old computer,” in apparent contradiction of Zambrano’s testimony, since Lynch was in that instance relying only on certified records from Hewlett Packard and the Ecuadorian Judicial Conference, and what was contained in the short Tarco declaration that the defendants themselves had filed in his court.

Donziger attorney Rainey Booth, of Houston-based law firm of Littlepage Booth, handled the cross-examination of Lynch, attempting to contain the damage. Booth suggested that there may have simply been some good-faith confusion by Zambrano about which computer he used to compose the judgment. Alternatively, Booth suggested, perhaps Zambrano had written the judgment on a third computer whose existence had been forgotten about by Zambrano and likewise totally overlooked by Tarco during his investigation.

Closing arguments in the case are to take place today, after which the parties will be given the opportunity to file post-trial briefs, so a ruling is not therefore not expected until early next year