A witness expected to play a key role in a Bucks County murder trial has been charged with lying to prosecutors, a potential blow to a case that took eight years to bring to court.

Kyle Page, 29, of Levittown, testified on three occasions that he watched his cousin Ckaron Handy shoot and kill 30-year-old Kevin Battista in a botched Levittown drug deal in 2006, according to court documents.

But in an affidavit dated Friday, police said that Page was in prison when the shooting occurred, and that Page admitted his false testimony last month in two letters to Christopher Rees, a deputy district attorney. Page was charged with three counts of perjury.

Rees, who is prosecuting Handy, declined to comment on the allegations against Page or describe how they might effect the trial. He also declined to say whether prosecutors were preparing to present any other eyewitnesses as part of their case against Handy.

Handy's court-appointed defense attorney, Michael Goodwin, also declined to comment.

Authorities have charged that Handy, now 27, shot and killed Battista shortly after 2:15 a.m. on Dec. 7, 2006, when Battista - a father of two - was seeking cocaine in the Fleetwing section of Bristol Township.

Handy wasn't arrested until October 2012, a scenario District Attorney David Heckler attributed at the time to "uncooperative witnesses, many of whom were under investigation for other crimes."

Page, whose extensive criminal history includes convictions for theft and indecent assault, claimed on three occasions to be an eyewitness who could identify Handy as the shooter, according to court documents: twice to a grand jury in April 2009, and at Handy's preliminary hearing in January 2013.

But two months ago, police said, they discovered Page was in the Bucks County Correctional Facility at the time of the shooting, and he subsequently apologized in letters to Rees, according to court records.

An affidavit of probable cause did not state what prompted authorities' belated discovery of Page's whereabouts.

The trial began Monday, and on Wednesday, Bristol Township Detective Timothy Fuhrmann testified about the investigation. Jimmy Cooper, 45, of Bristol Township, also took the stand, saying that he was dealing drugs in the area on the night of the shooting but that he did not see who pulled the trigger.

Defense attorneys sought to cast Cooper, who had been convicted on various drug charges, as an unreliable witness who provided testimony in return for a new sentence on one of those convictions. The trial was to resume Thursday.