A District police officer was convicted yesterday of accepting sex from a woman rather than arresting her for prostitution and of later trying to prevent her from testifying before a grand jury investigating the incident.

Albert J. Sell gasped and shook his head, and his wife sobbed "He didn't do it, he didn't do it," when the D.C. Superior Court jury announced that it had found Sell guilty of the three charges against him -- sodomy, accepting a bribe and obstruction of justice.

Sell, who maintained his innocence throughout the five-year case, was accused of taking a prostitute to an empty parking garage early in the morning of Sept. 30, 1980, and of having her perform a sex act on him in exchange for not arresting her after he discovered the woman and a man in a pickup truck.

At the time, the woman complained to other police officers about the event. In March 1981 the woman, Lois Frontuto, agreed to wear a police tape recorder and to arrange to meet Sell. In a taped account of that meeting played during the trial, Sell urged Frontuto not to testify before a grand jury and warned her that if he were convicted, other police officers would lock her up "right and left." Sell was charged with obstruction of justice in connection with that incident.

Sell, a nine-year veteran of the force at the time of the incident, stood as the jury, after deliberating for about two hours, returned to the courtroom. But he sat down as the jury foreman read the verdict. He turned to his wife, who sat in the row behind him, and whispered that he was innocent.

"I know, I know," she sobbed. "It's not fair, it's not fair."

Sell's lawyer, Robert E. Greenberg, said he was "shocked at the verdict" and will "look at his options." Sell could receive a sentence of up to 18 years in prison.

Prosecutor Mark Dubester portrayed Sell as a man who had "betrayed" his position as a police officer and had a reputation for spending too much time in the Thomas Circle prostitution corridor away from his patrol beat in September 1980.

Frontuto testified that she knew something "unusual" was happening when Sell, after finding her with a man, escorted her to his cruiser and told her to sit in the front seat did not handcuff her. She said that when Sell finally found an empty garage, she asked him what he wanted and then performed a sex act on him.

Greenberg described Frontuto as a vindictive woman who would attempt anything, including accusing a police officer of a crime, to prevent officers from interfering with her prostitution business.

One officer called by Greenberg testified that Frontuto had threatened him. Much of the testimony about Frontuto, however, was limited. Judge Peter H. Wolf, who presided at the trial, denied a defense motion to have other police officers testify about Frontuto's reputation, saying, "As we all know from watching Jack Webb and "Dragnet" . . . , you have to take your witnesses where you can get them . . . and they are not always savory characters."

Sell testified that he had not arrested Frontuto because his only concern was to "get away from her" after she began screaming and cursing at him after he interrupted her and a man.

He said he believed that Frontuto had filed a complaint against him because he told her to return money that the man accused her of taking from the dashboard.