Mettur judicial magistrate S. Sreedharan granted her the bail on a personal surety of Rs.5,000 and ordered her not to speak on the issue after she formally surrendered before the magistrate's court.
The hearing in the case was adjourned to Dec 16.
The actress had defended in media pre-marital sex, leading to protests from several groups.
The court had issued a non-bailable warrant against the actress for her failure to appear before it Nov 11 in connection with the defamation suit.
Khushboo had then moved the Madras High Court for an anticipatory bail as she apprehended arrest.
The plea had come up for hearing at the Madras High Court Tuesday and her lawyer Asokan had contended that she could be granted an anticipatory bail as she had not committed "any gruesome crime".
After hearing the arguments, Judge Z. Hussain had posted the hearing for Wednesday, but Khushboo's counsel announced the same day their decision to withdraw the bail application.
Outside the Mettur court premises, police had to resort to baton charge to contain protesting crowds who were demanding jail for the actress.
Volunteers of the Dalit Panthers of India and the Pattali Makkal Katchi, under the banner of a Tamil Protection Movement, had gathered in large numbers to demonstrate against Khushboo.
They threw tomatoes and rotten eggs and also waved banners condemning the actress. The crowd turned violent when a large number of policemen in riot gear stopped them from getting close to the court building.
Similar protests continued for the fifth day against actress Suhasini Mani Rathnam, who had defended Khushboo, and four cases of defaming Tamil culture have been filed against her.
Meanwhile, the Madurai Bench of the Madras High Court Wednesday admitted Khushboo's petition seeking to quash yet another case filed against her.
Admitting the petition, Justice M. Chockalingam issued notice to the complainant and has posted the case for hearing Thursday.
Khushboo's lawyers submitted to the court that she "might not be able to attend every hearing" as a number of cases have been filed against her in various places in Tamil Nadu.
The hearing in the matter was posted for Nov 21.