Robert Durst, the 72-year-old New York real estate heir and celebrity murder suspect, pleaded guilty Wednesday to a federal gun charge in New Orleans, clearing the way for his prosecution in Los Angeles on the execution-style slaying of his longtime confidante and spokeswoman more than 15 years ago.

Durst pleaded guilty to a charge of being a felon in possession of a firearm. He agreed to an 85-month prison sentence in an elaborate deal with federal prosecutors that is expected to have him back in California by Aug. 18 to be arraigned on the murder of Susan Berman.

U.S. District Judge Kurt Engelhardt accepted Durst’s guilty plea conditionally, pending completion of a probation report. He set formal sentencing for April 27 but said Durst could be sentenced sooner.

The charge stemmed from a March 14 search of Durst’s room at the JW Marriott Hotel, where FBI agents found, among other things, a flesh-colored latex mask with salt-and-pepper hair, five ounces of marijuana, more than $100,000 in cash and a loaded .38-caliber Smith and Wesson revolver.

Assistant U.S. Attorney Michael McMahon said after the sentencing that he suspects Durst was headed to Cuba to evade arrest in Berman’s killing.

His arrest in New Orleans came as a popular HBO documentary miniseries, “The Jinx,” renewed interest, both publicly and among Los Angeles authorities, in the 2000 slaying.

In the final episode of the series, Durst made what some observers described as a confession while muttering to himself off-camera. Still wearing a microphone as he apparently went to the bathroom, Durst said, “What the hell did I do? Killed them all, of course.”

He arrived in Engelhardt’s courtroom about 9:30 a.m., appearing frail and struggling to hear the proceedings through his right ear, the lone “relatively good” one, said his longtime attorney, Dick DeGuerin.

Durst wore orange St. Charles Parish jail scrubs that sagged around his gaunt frame, a chain across his backside and black-rimmed glasses on his pallid face. He acknowledged to Engelhardt that he was on “a whole slew” of medications but said he could understand the proceedings.

“I plead guilty,” Durst said, acknowledging that he indeed was a felon in illegal possession of a weapon, for which the maximum sentence is 10 years.

Durst, who jumped bail in 2001 after being charged with the murder of a neighbor in Galveston, Texas, pleaded guilty in 2004 to interstate transportation of a firearm and possession of a firearm by a fugitive from justice. Those convictions made it illegal for him to carry a gun.

Durst, who claimed he killed the neighbor, Morris Black, in self-defense, was acquitted of murder in that case, even after he dismembered the man and dumped his remains in Galveston Bay.

DeGuerin, who defended Durst in that case, declined to take questions after Durst’s guilty plea Wednesday, saying only that the plea served to “clear the decks” so Durst could return to California to face the murder charge.

“Bob Durst did not kill Susan Berman. He doesn’t know who did. He wants to prove it,” DeGuerin said before hopping into an SUV on Poydras Street.

Under his plea agreement, Durst and the government asked Engelhardt to recommend that he serve his sentence at a low-security federal prison on Terminal Island in Los Angeles. It also includes an agreement with Orleans Parish District Attorney Leon Cannizzaro’s office not to prosecute Durst on any state charges as long as his 85-month sentence holds up.

Following the search of the hotel room, Cannizzaro’s office originally charged Durst with similar state counts of possessing a firearm as a convicted felon while in possession of illegal drugs. Cannizzaro’s office dropped those charges when federal prosecutors indicted Durst in April.

The plea deal includes an agreement by federal prosecutors in the state of New York not to prosecute Durst related to cash he received in the mail while staying in New Orleans.

Durst’s attorneys had fought to suppress the evidence from two searches of the hotel room, the first by FBI agents and the second by Los Angeles police. DeGuerin and Durst’s attorney in New Orleans, Billy Gibbens, argued that the first search came without a warrant and the second was fatally tainted by the first.

The judge handling the case at the time, U.S. District Judge Helen “Ginger” Berrigan, denied that bid, ruling that the later warrant search was valid on its own.

DeGuerin acknowledged to Engelhardt on Wednesday that there “was not a question of factual guilt” in Durst’s possession of a firearm as a convicted felon and that he was “satisfied that it was fairly litigated.”

The agreed-upon 85-month sentence for Durst is contained in an all-or-nothing plea deal. Engelhardt can endorse it or vacate it, but he can’t adjust the sentence upward or downward.

The murder charge Durst now faces in Los Angeles was filed after the closing episodes of the HBO miniseries, which elevated suspicions about Durst’s role in three killings: Berman’s in California, Black’s in Texas and the 1982 disappearance of Durst’s wife in New York.

DeGuerin has argued that Durst’s latest legal troubles stem from authorities piggybacking off the show’s insinuations rather than any new hard evidence.

Deguerin has long said the real estate heir embraces the chance to return to California to address the murder charge for Berman’s killing. However, that didn’t appear to be the case when the FBI tracked down Durst inside the Canal Street hotel.

He had checked in there under an alias, Everette Ward, and had a fake ID and a mask that pulled down over the neck. He also had a passport in his real name, the loaded revolver and cash stuffed in small envelopes.

He will forfeit some $117,000 that authorities found on him, along with the gun and marijuana.

McMahon, the prosecutor, described the murder prosecution against Durst in Los Angeles as “a tough case. It’s certainly not a slam dunk. I think he will be convicted.” But he declined to elaborate on his hunch that New Orleans was a stopover for Durst on his way to Cuba.

It was not the first time Durst fled to the Crescent City while facing a pending murder prosecution. After being charged in 2001 with killing and dismembering Black, Durst jumped bail and moved to New Orleans, where he rented an apartment under a woman’s name. The authorities later found a wig used to support his alias and a money clip that had belonged to Berman.

“He’s just another defendant, but he’s not,” McMahon said. “He’s an interesting character, to say the least.”

Follow John Simerman on Twitter, @johnsimerman.