Once the public and press were out of the room, convicted murderer Jodi Arias took only seconds to admit that she killed her boyfriend, Travis Alexander, in a frenzied attack after a day of rough sex in June 2008, secret court transcripts revealed for the first time Tuesday.

“Did you kill Travis Alexander?” Arias’ lawyer Jennifer Willmott asked the former waitress during a closed-court session in the death-penalty phase of her trial Oct. 30.

“Yes,” Arias instantly replied.

“When is the first time that you admitted that to anyone?” Willmott then asked.

“In 2010,” Arias testified.

“This happened in 2008, didn’t it?” the lawyer said.

“Yes,” said Arias.

“Why did it take you two years to admit that . . . that you did it?” the lawyer prodded.

“It took me that long to be able to admit to myself that . . . that I did it,” Arias replied.

Arias made the stunning admission during a day and a half of closed-door testimony after an Arizona judge kicked the press and public out of the courtroom in the sensational case.

But the nearly 250 pages of transcripts of the testimony were released this week after The Arizona Republic won a legal battle to make them public.

Arias, 34, had already been convicted of first-degree murder in May 2013 in the killing after a lurid trial in which evidence showed that Alexander, 30, a charismatic motivational speaker and salesman, was stabbed 27 times and then shot in the head.

Prosecutors said Arias planned the murder in a jealous rage after Alexander dumped her.

Arias at first denied any involvement in the grisly death, and concocted a story blaming the killing on mysterious masked intruders.

But two years after her arrest, she admitted that she had killed her lover — claiming he attacked her after a day of rough sex in his Mesa, Ariz., home.

The medical examiner determined Arias stabbed Alexander in the back, torso and heart, slit his throat from ear to ear — nearly decapitating him — then shot him in the head.

Prosecutors never got a chance to cross-examine Arias during the closed sessions last fall before an appeals court ordered Judge Sherry Stephens to reopen court, which brought an end to Arias’ testimony. The judge at the time had said she was closing the courtroom to hear testimony from “a secret witness.”

But the witness turned out to be Arias herself — and she now must decide whether to take the stand again in open court or have Stephens strike everything she told the jury behind closed doors when the death-penalty phase of the trial resumes soon. The trial was suspended Nov. 3.

The newly revealed testimony begins with Arias expressing remorse and explaining that her behavior in the time before and after the murder — placing a call to Alexander’s voicemail and driving to Utah to visit a potential suitor — were attempts to cover her tracks.