Bill Cosby's lawyers pressed a judge Tuesday to keep his potentially damaging testimony from a lawsuit out of his sexual assault trial, saying it would be fundamentally unfair since Cosbythought he had a promise from the government that he would never be charged.

The defense insisted Cosby had an oral promise from a former prosecutor that he wouldn't be arrested over a 2005 sexual encounter with Andrea Constand. Cosby never would have testified in her lawsuit if he knew the testimony could one day be used against him in criminal court, they said.

A new prosecutor charged Cosby last year, days before the 12-year felony statute expired. Cosby, 79 and blind, smiled Tuesday as he arrived at the suburban Philadelphia courthouse with his handlers.

Montgomery County Judge Steven O'Neill, who is hearing pretrial arguments, suggested that Cosby's decision to testify could have been strategic. He noted that there's no evidence Cosby's lawyers called to get the promise in writing before letting him testify. And what's more, he said, they might have thought it was better for him to testify than have him plead the Fifth Amendment and have a civil jury think he had something to hide.

Defense lawyer Brian McMonagle said O'Neill would set a bad legal precedent if he lets in testimony given based on a promise with law enforcement.

"I don't want DAs making promises that they don't later keep," McMonagle argued. "That strikes at the heart of fundamental unfairness."

The pretrial hearing is expected to last two days, with another hearing on the evidence set for December.

O'Neill must also decide if 13 other accusers can testify against Cosby at the June trial to show they were drugged and molested in a "signature" fashion. Defense lawyers said prosecutors are reaching back to the "casting couch" era to round up female accusers and build a "stale" sexual assault case against him. They want O'Neill to exclude the "prior bad act" testimony.

And they went through a time warp to prove their point, challenging sexual misconduct claims that span the freewheeling 1960s, patriotic 1980s and gender-bending 21st century. The long-married Cosby testified in the deposition about a series of affairs with young women and said he sometimes gave them pills or alcohol before sex. Many now say they were drugged and molested.

However, defense lawyers say there's little but hazy memories to go on. In a court filing Monday, they said the women's memories have been compromised by time and widespread media coverage of the case.

"The fact that even the most fervently held memories can actually be tainted — or altogether false — is supported by a vast existing and growing body of science," McMonagle wrote.

Cosby remains free on $1 million bail. It's been a half-century since the comedian became the first black actor to star in a primetime TV show, "I Spy," and more than 20 years since his top-ranked homage to black family life, "The Cosby Show," stopped filming.

He appeared to have beaten back the Temple University employee's sexual assault complaint in 2005 when prosecutors said there wasn't enough evidence to charge him.

But a new prosecutor, District Attorney Kevin Steele, reopened the Montgomery County case last year amid new evidence: the scores of public accusers and a newly unsealed deposition that showed Cosbyacknowledging he gave Constand three unlabeled pills and some wine before sticking his hand down her pants. Constand, then 30, said she was only semi-conscious after taking what she thought were herbal pills. She had met Cosby, a Temple booster, through her job and said she went to his house that night for career advice.

Constand settled her lawsuit against Cosby in 2006. The defense, in their motion Monday, said her accounts of her relationship with Cosby changed in her initial police statements — and they said the two had been intimate before.