PORTLAND, Ore. — Lawyer Brandon Mayfield, wrongly arrested by FBI agents after the 2004 Madrid terrorist bombings, has settled his lawsuit against the U.S. government for $2 million, his attorney said Wednesday.

The lawsuit said Mayfield was wrongly detained for two weeks in 2004 on the basis of a misidentified fingerprint.

The FBI and the U.S. attorney general's office did not immediately return calls from The Associated Press seeking comment.

Mayfield, a convert to Islam, said he was arrested because of his faith.

"Not only does my detention as a material witness in the Madrid bombing underscore the fallacy that fingerprint identification is reliable, I hope the public will remember that the U.S. government also targeted me and my family because of our Muslim religion," he said in a separate news release Wednesday.

The FBI did not immediately return messages seeking comment.

An earlier report by the U.S. Justice Department's Office of the Inspector General said FBI examiners were not aware of Mayfield's religion when they conducted fingerprint analysis.

Mayfield was jailed on a material witness warrant but was released after the FBI acknowledged the fingerprint was not his.

The government acknowledged in the settlement that it "performed covert physical searches of the Mayfield home and law office, and it also conducted electronic surveillance targeting Mr. Mayfield at both his home and law office," according to a news release from Mayfield's attorney, Elden Rosenthal.

As part of the settlement, the government again apologized to the Mayfield family, Rosenthal said.

The settlement allows Mayfield to continue to pursue his challenge of the USA Patriot Act, Rosenthal said. Mayfield claims the act violates the Fourth Amendment because it allows government searches without probable cause that a crime has been committed.

"The Patriot Act is decidedly not patriotic," Rosenthal said. "We will vigorously pursue this constitutional challenge to the highest courts in the country."