Ralph Griffith, a serial bank robber who penned a self-published book about his time in prison with Bernie Madoff, appeared in federal court Wednesday to face his fifth bank robbery charge.

Griffith spent his 68th birthday at the Mark O. Hatfield United States Courthouse, where he was ordered to remain in jail pending his trial for an alleged armed robbery of a Milwaukie Wells Fargo Bank in July, The Oregonian first reported.

The career criminal, who describes himself as the founder and executive producer of XAK Media Group, was released from California prison in August 2017 after spending time behind bars for three San Francisco bank robberies in 2003. He was also previously convicted of a bank robbery in 1985.

Shortly after his 2017 prison release, Griffith wrote a self-published book, The Real Bernie Madoff: Our 7 Years Together in Prison, about his time behind bars at a North Carolina federal prison with the former financier, who was convicted of running one of the biggest Ponzi schemes in history.

“I lived with the man,” Griffith said in a YouTube video about the book. “After about seven years I got a pretty good understanding about what Bernie Maddoff was up to.”

The 68-year-old has also written fictional accounts of his life of crime, including a four-paragraph story called “The Proper Way to Rob a Bank” and another involving a character “who inadvertently robs a bank and a star is born.”

On Wednesday, prosecutors argued that his stories about his misdeeds prove he is still a danger to the community. Griffith’s defense lawyer, Mark Ahlemeyer, insisted his client’s books are protected under the First Amendment.

Ahlemeyer declined to comment about the allegations to The Daily Beast on Wednesday, citing the “active criminal case.”

On July 26, authorities allege Griffith walked up to a Wells Fargo teller at around 10:30 a.m. wearing sunglasses, a black wig, a white surgical mask under his chin, and clear gloves. Court records show Griffith rested what authorities believed to be a black handgun on the counter before pointing it at the teller and saying, “Give me the money and no one will get hurt.”

After the teller handed him a stack of cash with a GPS tracker hidden inside, a second bank employee walked over—and Griffith allegedly demanded money from her as well.

“You too, sweetie,” he said, according to a federal affidavit obtained by The Oregonian, before stuffing the cash into a grocery bag.

Griffith allegedly threw away the two GPS devices and left. One tracker was later located in some bushes with a ripped $20 bill attached, and the second was found in the middle of the street. Surveillance video caught Griffith fleeing the scene in a blue Nissan Sentra.

On Tuesday, Griffith was allegedly on his way to rob another bank when he got into a minor accident, prosecutors allege. While searching the car, authorities found multiple medical masks, wigs, and black sunglasses in the front passenger seat.

“It is my belief that Griffith was on his way to conduct another bank robbery at the time of his traffic accident and arrest,’’ FBI agent Zachary Clark reportedly wrote in the affidavit.

Griffith is currently being held at the Multnomah County Detention Center. He is expected to be back in court on Oct. 24.