Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

NANTUCKET, Mass. — A Massachusetts judge on Monday ordered Kevin Spacey to stay away from his accuser, during the actor's first courtroom appearance on a sex-abuse charge.

The Oscar winner, facing felony indecent assault and battery, showed no emotion during his 10-minute-long hearing before Nantucket District Court Judge Thomas Barrett.

Defense lawyer Alan Jackson entered a not-guilty plea on behalf of his client, according to court documents. Spacey was ordered to have no contact with the alleged victim or his family.

“Sir, you’ll meet with probation. You’ll sign those conditions,” Barrett told Spacey. “You’re required to stay away and have no contact, direct or indirect, with the alleged victim."

Barrett granted a defense request that cell phone data of the accuser be preserved for a six-month period after the July 7, 2016 incident.

Jackson said there could be texts or social media chatter there, helpful to his client.

"This is data that we believe is, not only potentially exculpatory, but likely exculpatory for Mr. Spacey,” Jackson told the court. “I simply don’t want to see any of that data deleted, destroyed — even inadvertently.”

In a court filing on Monday, Jackson previewed his defense strategy and attacked the victim as unreliable, accusing him of creating "an entirely false persona" during that 2016 encounter.

"He claimed he was a 23-year-old college students studying business at Wake Forest University," wrote Jackson, a former prosecutor from Los Angeles best known for winning a murder conviction against famed music producer Phil Spector.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"In fact, aside from his name, everything (the victim) told Mr. Fowler was a lie. In point of fact, (the victim) was 18 years old, not in college and had taken a summer job bussing tables on the island."

Spacey's next pre-trial hearing was set for March 4. The judge ruled Spacey could skip that hearing, but had to be near a telephone in case the court had any questions for him.

Spacey — who wore a gray suit, dark vest, a purple-and-white floral pattern shirt and a purple tie with white dots — was mobbed by reporters and camera crews as he arrived and left court.

A court clerk read the charges, calling him by his birth name. "Kevin S. Fowler." But throughout the hearing, he was called by his acting name, Spacey.

The charges Spacey faces stem from an allegation that first came to light in November 2017 when the accuser’s mother, a former Boston TV news anchor, came forward.

Heather Unruh, said Spacey groped her then 18-year-old son during a random meeting in July 2016 at the Club Car Restaurant in Nantucket.

Unruh's son had said he wouldn’t be in court for Monday's hearing.

"By reporting the sexual assault, my client is a determined and encouraging voice for those victims not yet ready to report being sexually assaulted," the accuser's lawyer, Mitchell Garabedian, said in a statement on Monday before the hearing. "My client is leading by example."

Spacey faces up to five years behind bars, if convicted.

Spacey has generally kept a low-profile since several men have accused him of sexual misconduct — allegations he denied.

Unruh made her accusations just five days after Netflix, makers of his hit show "House of Cards," cut ties with Spacey.

The actor tweeted a video on Christmas Eve looking into the camera and speaking in a southern accent that appeared to mimic his “Cards” character, President Frank Underwood. He seemed to reference his “Cards” termination.

“Despite all the poppycock, the animosity, the headlines, the impeachment without a trial. Despite everything," said Spacey, wearing a Santa Claus apron and standing in a kitchen. "Despite even my own death, I feel surprisingly good and my confidence grows each day that soon enough you will know the full truth.”

Hours after the Massachusetts hearing, Spacey was pulled over for speeding at Reagan National Airport, authorities said. He was speeding on airport property and was let go with a warning, according to Metropolitan Washington Airports Authority spokeswoman Athena Hernandez.

Adam Reiss reported from Nantucket, David K. Li and Austin Mullen reported from New York.