NORFOLK, Va. (AP) - A Virginia man who prosecutors say told an undercover agent that he wanted to commit jihad and also tried to join the U.S. military has been arrested.

Federal authorities said Thursday that they arrested Shivam Patel on charges he hid information from military recruiters.

The U.S. Attorney's office said in a press release that the 27-year-old told an undercover agent and a confidential source that he wanted to join a "Muslim army" and to commit jihad. Prosecutors say the man from Williamsburg had also visited China and Jordan.

According to the criminal complaint, Patel traveled to China in July 2016 and then flew to Jordan, where he was arrested, detained, and deported to the United States.

When Patel tried to join the U.S. Army and Air Force in December of 2016, prosecutors said he failed to disclose his foreign travel and his arrest.

Patel faces a maximum penalty of five years in prison if convicted.

Court records don't list a lawyer for Patel.