Getting Natasha Lyonne in court hasn't been quite as easy as pie. 

Finally acting on a long-standing warrant for her arrest, the American Pie actor turned herself in Friday to answer to a variety of charges stemming from a 2004 run-in with her  former neighbor, in which she allegedly threatened to sexually molest the neighbor's dog.  

A bench warrant was issued for Lyonne's arrest in January after she missed her fourth court date pertaining to the dog-abuse incident.  

(An earlier warrant for a skipped court day was rescinded when the court learned Lyonne had spent most of last summer being treated for hepatitis C, a heart infection and a collapsed lung.)  

In any case, Lyonne showed up in Manhattan Criminal Court at last on Friday, accompanied by drug counselor Heather Hayes. 

Hayes told Judge Anthony Ferrara that the Slums of Beverly Hills star, whose legal and health problems have kept her out of the Hollywood spotlight for the past couple years, completed an in-patient drug treatment program in February and continues to attend out-patient rehab. 

"She's done excellently, very well," Hayes said.

Noting that she has already completed her court-ordered treatment and has paid $2,000 in restitution, Ferrara ruled that all charges—which include criminal mischief, harassment and trespassing—will be dropped if Lyonne can stay out of trouble for the next six months. 

In December 2004, police nabbed the New York native after she allegedly burst into her neighbor's apartment, grabbed and threatened to molest the tenant's dog, and ripped a mirror from the wall. Nearby tenants called the cops, who arrested Lyonne later than night at her own Grammercy Park pad.

The actor has been lucky enough to avoid the slammer so far, at least. Two years prior to her not-so-friendly house call, Lyonne copped a plea that kept her from having to serve jail time on DUI charges. In return her driver's license was suspended and she was sentenced to six months' probation and 50 hours of community service.