Federal and Virginia state officials are investigating allegations that Prince William County prosecutor Paul B. Ebert twice received sexual favors in exchange for lenient treatment of a woman convicted of drug dealing in the county.

June Kay Carter, 26, said in interviews that she had told investigators that Ebert had sex with her in December in his courthouse office in Manassas and in 1982 at the Woodbridge Holiday Inn after she was placed on probation.

Carter, in interviews at the Prince William County jail where she is serving a sentence for probation violations, said she told FBI agents that Ebert recommended or approved her release from jail on personal recognizance and her participation in community diversion and work-release programs despite her history of escape, failure to make court appearances and continuing drug abuse and prostitution. Carter said Ebert also fixed several traffic tickets for her.

"I have never and never did touch that girl," Ebert said in an interview in which he called the accusations of any improper conduct "a damned lie."

Ebert said, "It became fairly apparent she became infatuated with me." He also said that Carter telephoned him frequently and that he "would lead her on" because he "more or less cultivated a source . . . ."

Ebert, 48, county prosecutor for 18 years, said he had known Carter since she was a teen-ager. He said that the lenient treatment came because he felt sorry for her or because she worked occasionally as an informant for local vice officers.

Ebert said the FBI and the U.S. attorney's office in Alexandria are investigating Carter's allegations. Ebert said his records involving Carter and another woman informant have been subpoenaed.

The FBI declined to comment on the investigation except to confirm that two FBI agents visited Carter in her Prince William jail cell April 9. A spokesman for the U.S. attorney's office also declined comment in an official statement.

Ebert said that in an effort to "to clear my name," he had requested Virginia Attorney General Mary Sue Terry to authorize a State Police investigation. State officials said yesterday the investigation had been approved.

Ebert said he felt compassion for Carter and repeatedly tried to help her straighten out her life.He said he became frustrated this year with what he called her repeated drug use and unreliability.

"At that point, I was disgusted," said Ebert. "I wouldn't answer her calls. I threw her letters into the trash can."

Ebert said he believes Carter is now angry at him. "Maybe I was too good to her over the years . . . . I'm just hopeful the truth will prevail."

Carter said she passed a lie detector test given by the U.S. attorney's office in Alexandria last week.

Ebert said that he passed a private lie detector test on Tuesday on the advice of his friend and attorney, Blair Howard of Alexandria.

Howard is the son and law partner of Alexandria attorney T. Brooke Howard, who has represented Carter at Ebert's request at least twice, including her probation revocation hearing in March.

Ebert said that when he first heard about Carter's allegations against him after the March hearing, he asked the elder Howard to find out what she was talking about.

Carter said the elder Howard declined to discuss her allegations against Ebert with her. Carter quoted the elder Howard as saying he would "try and help Ebert out in any way I can."

Brooke Howard declined comment yesterday on his role in the Carter case.

Brooke Howard represented Carter on March 21 when she was convicted of violating probation on a 1982 sentence for distribution of amphetemines. Carter is awaiting transfer to a state prison to serve a 2 1/2-year sentence imposed by Prince William Circuit Court Judge Herman A. Whisenant Jr., who has presided over Carter's cases since 1982.

Ebert said he also recommended that Howard serve as Carter's attorney when she was charged in 1984 with speeding and driving with a revoked license and expired stickers in Alexandria. The case was dropped by prosecutors.

According to court records, Ebert intervened on Carter's behalf on several occasions:

In July 1985, Ebert's office recommended to Whisenant that Carter be enrolled in the county's community diversion program. A probation report at the time detailed her traffic offenses, urine tests that showed continued use of cocaine and other drugs and statements to probation officers that she used illegal drugs obtained in the District of Columbia.

In August, Ebert recommended that Carter be released from jail on personal recognizance pending a formal hearing on her probation revocation later that month. Whisenant approved her release with strict conditions that she avoid drug use and remain in the area.

In September, Carter was approved for a community diversion program. At that same Sept. 6 court hearing, Ebert's office recommended that a possession of cocaine charge against her be dropped. Ebert said yesterday that the case involved an insignificant amount of cocaine. A charge of possession of marijuana had been dropped earlier.

On Sept. 10, Carter was driven by Ruth D. Johnson to Roanoke where Carter was to participate in an 18-month drug rehabilitation program. Carter left within five minutes after Johnson departed and was not heard from for weeks.

According to Carter and court records, she escaped to Tennessee with friends, and called Ebert in October and offered to give herself up. Carter was returned to jail Oct. 22.

Carter said she told federal authorities that in late December, a few days before Christmas, she was escorted from the jail to Ebert's office where she performed a sex act on him.

Carter left the jail in January. According to court records, a court-appointed attorney, Theodore Pappas, requested that Carter be allowed to participate in the jail's work-release program at her father's plumbing business in Prince William County. Judge Whisenant approved the program on Jan. 10, but Carter later was suspended from the program after urine tests for drugs came back positive.

Pappas declined to comment on his brief role in the Carter case. "Whatever I say, somebody is going to be mad at me, so I have no comment," he said.

J. Edward Flournoy, who represented Carter until last August, said he does not comment to the news media on cases he handles.

Carter said this week she had been asked by the FBI not to discuss details of the case further. She first detailed many aspects of the case in an interview with free-lance reporter Elizabeth Roberts, who was working on an unrelated radio report about women and mothers in jails when she heard about Carter's case.

Carter, who in interviews acknowledged her use of drugs as well as her role as a prostitute in the county, has appeared in Prince William courts more than a dozen times, and in courts of Stafford County, Alexandria and the District of Columbia.

The federal investigations of Carter's allegations are separate from a county grand jury investigation in which a man convicted of raping and sodomizing a woman had charged that the commonwealth attorney's office withheld evidence that might have helped clear him. Ebert said the inmate, Kenneth L. Titcomb, is trying to reopen the case that he lost in court.