A real estate agent and an FBI agent have been charged in an alleged bribery scheme using a program that protects renters in the District from being evicted when landlords sell their property, according to documents filed in federal court.

Two criminal complaints say the real estate agent obtained confidential information on renters from an employee at the D.C. Department of Housing and Community Development and additional personal details from the FBI agent, who is accused of tapping a database restricted for use by law enforcement. The real estate agent is accused of using the personal information to solicit lucrative real estate deals in areas of the city that are gentrifying, such as Shaw and Columbia Heights, where property often sells quickly and for large profits.

The U.S. attorney’s office for the District identified the FBI agent as David Paitsel, 38, of Asheville, N.C., and the real estate agent as Brian Bailey, 49, of Silver Spring, Md. Each was charged with a single count of bribery of a public official. The unidentified housing official was not charged; he is listed in court documents as a witness.

Magistrate Judge Deborah A. Robinson on Thursday freed both suspects pending hearings in May. Attorneys for Bailey and Paitsel were not listed in court documents, and neither suspect could be reached for comment.

Prosecutors said Paitsel had been assigned to the FBI’s Charlotte office. During the period of the alleged scheme, prosecutors said, he was a supervisory agent at FBI headquarters in Washington.

An FBI spokeswoman did not return calls seeking comment on the agent’s status with the bureau.

According to the complaint, the alleged scheme involved a program called the Tenant Opportunity to Purchase Act, also known as TOPA. It allows tenants first right to purchase their homes if their building’s owner decides to sell the property.

Before a property goes up for sale, tenants must be sent a notice describing their rights. Residents can sell their first-refusal rights to a third party, and the District’s housing authority keeps a list of tenants eligible for to make such sales. That list is supposed to be confidential, court filings state.

Prosecutors said Bailey paid the housing official to provide him with lists of properties on the market and the names of renters living in them. The complaint says Bailey then paid the FBI agent to run the names through the bureau’s database to obtain phone numbers.

“David I need your help on this one,” one email from Bailey to Paitsel says, according to the complaint. “If I can get just one of the tenants to sign it would be awesome.”

Prosecutors said the real estate agent targeted the tenants to convince them to sell him their rights of first -refusal, sometimes for tens of thousands of dollars. Prosecutors said he often resold those rights to title companies, in one case for $250,000 for a building in Columbia Heights.

In an example described in the complaint, the housing official sent Bailey a sale notice for a building in Logan Circle in 2017. The complaint says Bailey emailed Paitsel for information. Prosecutors said the FBI agent made 49 queries on the internal database and emailed Bailey with contact information for one tenant.

“The information appeared to be copied and pasted” from the computer screen, prosecutors said.

That tenant sold his rights to Bailey for $35,000, the complaint says. Bailey then sold those rights to a title company in the District and was wired $50,000, according to the complaint. It asserts that Bailey paid Paitsel $6,500 in the transaction.