Image copyright AP Image caption Mufid Elfgeeh tried to recruit others to fight with Islamic State militants in Syria, police say

A man accused of planning to assist the Islamic State militant group and attempting to murder US soldiers has pleaded not guilty to all charges.

Mufid A Elfgeeh, 30, a naturalised citizen from Yemen, was arrested in May after an undercover operation.

Mr Elfgeeh, from Rochester, New York, tried to buy two handguns from an FBI informant, court documents said.

He allegedly planned to kill Shia Muslims and American military personnel returning from the Middle East.

The hearing on Thursday was unusually long, as the entire indictment against Mr Elfgeeh was translated into Arabic for him, a local newspaper reported.

Image copyright AP Image caption Mufid Elfgeeh was born in Yemen

His lawyer told the court Mr Elfgeeh does speak some English but he wanted to make sure the accused fully understood the allegations against him, according to the Rochester Democrat and Chronicle.

Court documents say that Mr Elfgeeh was placed under close surveillance more than a year ago when he started posting tweets in support of Islamic State (IS) militants.

He urged people to donate money to the militants, suggesting people should give a third of their salary.

He then tried to persuade two undercover informants and one other to go to Syria "and fight on behalf " of Islamic State militants, according to prosecutors.

Prosecutors said Mr Elgeeh wanted to buy handguns to carry out shootings, saying he might target US military personnel returning from the Middle East and Shia Muslims living in the Rochester area.

He allegedly bought the weapons, which had been disabled by the FBI, from one of the informants.

"As this case shows, our agents and prosecutors are using all the investigative tools at our disposal to break up these plots before individuals can put their plans into action," said Attorney General Eric Holder in a statement when Mr Elfgeeh was charged.

The FBI said it paid one of the informants $21,700 (£13,300) and provided help on immigration matters for that person's family.

The other informant, who had two previous convictions for drug offences a decade ago, was paid $7,000.