Mila Kunis may now work out in peace -- because the man accused of stalking the actress outside her gym has just been ordered to stay the hell away from her ... presuming he can even bail out of jail.
27-year-old Stuart Lynn Dunn was charged with two counts of felony stalking after cops say he followed Mila to her L.A. gym several times earlier this month and waited for her in the parking lot.
Dunn pled "not guilty" today in court -- where the judge then issued the protective order, barring him from harassing, threatening, assaulting, following, or contacting Mila in any way.
The protective order was issued as a condition of bail while Dunn awaits trial.
Bail was set at $150,000 -- much higher than usual in cases like this.
Dunn's due back in court May 31st.