Police took Shariful Islam Morol into custody after local residents detained him in Townshreepur village of Debhata upazila in Satkhira.
Police Inspector (Investigation) Rezaul Karim said officers went to the location after receiving information that a man was being held over an allegation of improper conduct.
Karim said police filed a case and sent Morol to court on 4 August.
Local residents alleged that Morol entered the home of a married woman on the night of 3 August and that they found the pair in a compromising situation.
They further alleged that residents surrounded the house, forced entry and held both people before police arrived.
Union Parishad member Bablur Rahman said residents had kept the two people detained until late at night.
Abdus Salam Master, president of the local Jamaat-e-Islami ward unit, described Morol as an active worker and said the organisation would verify the allegation before taking any action.
A video connected to the incident circulated on social media that night, drawing local discussion.