WILMINGTON, Del. (AP) — A federal magistrate ruled after a hearing Thursday that a man charged with accepting bribes while working for the State Department in Afghanistan should stand trial on corruption charges.

The magistrate judge said prosecutors had established probable cause that Kenneth Michael Brophy violated a law against public officials accepting illegal gratuities and another one barring government employees from being paid to help advance a claim against the U.S.

The 64-year-old engineer was arrested in October after traveling to Delaware to attend a wedding. He is accused of taking $30,000 from an Afghan company he supervised in a prison renovation in Kabul. Prosecutors also allege he helped that firm in successfully appealing the termination of other U.S. contracts based on shoddy work in building Afghan police facilities.

Brophy's attorney, Dan Lyons, argued that his client — then working under contract for the State Department — shouldn't be prosecuted because he was not a government employee. Lyons also said the payment Brophy received for helping the company with its U.S. Army Corps of Engineers appeal had nothing to do with anything he did in his official duties.

"In this case, the question is whether or not ... an offense was being committed," Lyons said.

Brophy, a civil and structural engineer, was working as a "personal services" contractor for the State Department.

Prosecutors noted that his contract with the government explicitly stated that he was considered to be an employee of the United States and was subject to the ethics rules for Department of State employees.

They also allege that he touted his position working for the Bureau of International Narcotics Law Enforcement at the U.S. Embassy in Kabul in vouching on behalf of the Afghan company, identified in court papers only as "Company No. 1" in talks with Corps of Engineers officials.

Attorneys for both sides argued about the intricacies of various federal laws and regulations defining who is considered a government employee or public official, and for what purposes.

"This is a difficult case because of the entanglement of factual and legal issues," said Magistrate Judge Sherry Fallon. Fallon nevertheless declared that prosecutors have established sufficient probable cause to proceed with their case against Brophy.

"There appears to be no dispute that he used his position ... to influence the U.S. Army Corps of Engineers on Company No. 1's behalf," Fallon said, adding that Brophy's contract with the State Department "speaks for itself."

Prosecutors filed court papers last year indicating that they are trying to avoid a trial in the case. This week, prosecutors were granted a fourth extension of time to indict as they continue trying to reach a non-trial resolution.