A judge on Friday ordered a psychiatric evaluation for a doctor who told reporters he had an affair with the former aide accusing Gov. James E. McGreevey (search) of sexual harassment.

Dr. Michael David Miller (search) was repeatedly urged by a public defender and Judge Donald Volkert to refrain from speaking during his 20-minute arraignment. He was arrested late Thursday on charges including pretending to be a law enforcement officer.

Despite their efforts, Miller made remarks including, "I have no law enforcement responsibility in this country whatsoever."

Miller, 51, pleaded not guilty to charges of impersonating law officers and public officials, creating false public alarm and making a false report to law enforcement.

The mental evaluation was ordered after Assistant Prosecutor Judy Gagliano listed a series of what she called "bizarre" statements attributed to Miller, including that he was a CIA operative and that a tenant has Al Qaeda ties and would blow up public buildings, including the courthouse where the hearing took place.

Miller, who was arrested at his home in Livingston, remained in custody on $500,000 bail.

Miller told the New York Post and Daily News, as well as WCBS-TV in New York, that he had an affair with Golan Cipel (search), a former homeland security adviser to the governor.

McGreevey announced last week that he is gay and said he had an affair with a man and intends to resign from office. Sources close to McGreevey, speaking on condition of anonymity, have identified the man as Cipel and said the Israeli had demanded millions of dollars to stay quiet.

However, Cipel says he is heterosexual and was subject to sexual harassment by McGreevey. His lawyer has said the extortion claims are false and that the governor's representatives offered money for Cipel to stay quiet. Cipel has also denied Miller's claim.