Federal law enforcement officials are investigating the re­lationship between a former ­Reagan administration official known for his role in the Iran-contra scandal and the government of Sudan, according to a search warrant affidavit filed in federal court.

Federal agents this month searched the ninth-floor Watergate condominium of former national security adviser Robert “Bud” McFarlane, who was approached in 2008 by Sudanese officials seeking access to the incoming Obama administration.

The FBI began investigating McFarlane after a 2009 Washington Post article outlined his ­involvement with the strife-torn African nation, which has long sought to ease U.S. economic sanctions and to be removed from the State Department’s list of state sponsors of terrorism.

The Post reported that Sudanese officials helped arrange a $1.3 million contract between the government of Qatar and McFarlane, who later met with two of the Obama administration’s top policymakers on Sudan.

But federal law enforcement officials allege, according to a search warrant affidavit filed March 5 in federal court in the District, that McFarlane was actually working as a lobbyist and consultant directly with the government of Sudan and “attempted to hide his relationship with Sudan by contracting with the country of Qatar.”

U.S. law makes it a crime to work as an agent of a foreign government without proper disclosure and prohibits business with Sudan because of its history of alleged genocide and other human rights violations in its decades-long civil war.

McFarlane has not been charged with a crime. His attorney, Barry Wm. Levine, said McFarlane did not violate any laws. “He has devoted his entire adult life to the interests of this country, and he cares deeply about the people of Darfur,” Levine said.

The search warrant was filed by prosecutors under seal, but it was publicly available online. Levine said the affidavit should not have been made public and was under seal to “protect the innocent — and he is such a person.”

McFarlane said previously that he was adhering to U.S. restrictions and that his attorneys concluded that he did not need to register for the contract with Qatar.

A spokesman for the U.S. Attorney’s Office for the Eastern District of Virginia, which is handling the case, said McFarlane “is cooperating with this ongoing investigation and, through counsel, has asserted his innocence.”

Before searching McFarlane’s condominium for business records, the FBI in 2010 searched his business e-mail account and went through the trash of the former offices of his small consulting firm in Arlington, according to court documents. McFarlane was interviewed by the FBI on the same day the search-warrant application was filed.

The affidavit quotes extensively from e-mail exchanges between or about McFarlane and officials within the government of Sudan in early 2009. The FBI also interviewed and obtained documents from an unidentified cooperating witness who they said was familiar with McFarlane’s contract with Qatar.

“I believe that these e-mails are evidence that McFarlane was entering into an agreement with the government of Sudan to lobby the U.S. government officials on behalf of Sudan,” the agent wrote in the affidavit.

Peter Hermann contributed to this report.