Robert Downey Jr. Back in Court

Robert Downey Jr. is heading back to court. At least on television, anyway.

The actor, 34, has signed on for his first role since being released from prison one week ago, landing a recurring part on David E. Kelley’s Fox dramedy “Ally McBeal.”

During his eight-episode stint, Downey might become a love interest for Ally, the character played by Calista Flockhart.

He begins shooting next week and will appear in the show’s season debut Oct. 23.

Sources close to Downey said that the actor was looking forward to acting again after leaving a drug treatment facility at California’s Corcoran State Prison on Aug. 2.

“David’s a genius, Calista’s awesome, and once again I have a choice of shirt colors,” Downey said in a press statement.

Downey’s last role was in “Wonder Boys” with Michael Douglas. He was nominated for an Oscar for 1992’s “Chaplin.”