The Army is investigating after former English Defence League leader Tommy Robinson posted a photo of himself with a group of young soldiers.
Mr Robinson also put a video of the scene on Facebook, in which the men could be heard cheering and shouting his name.
The Army said it was aware of the posts and "investigating the circumstances".
A spokeswoman said: "Far-right ideology is completely at odds with the values and ethos of the armed forces."
She added: "The armed forces have robust measures in place to ensure those exhibiting extremist views are neither tolerated nor permitted to serve."
The photograph and video appear to have been taken outside a motorway service area and Mr Robinson described the group as "young recruits".
Mr Robinson wrote on Facebook: "A moment like this makes it all worth while. Today I met real British heroes (sic)."
Responding to news of the investigation, Mr Robinson said in a video post that he had met the soldiers "by chance" and they should not be "left hung out to dry" for having their photo taken with him.
Imam Asim Hafiz, Islamic religious adviser to the armed forces, said "any form of racism, discrimination or extremism is taken extremely seriously and will be dealt with accordingly".
He added: "The armed forces remain absolutely committed to welcoming individuals from across all faiths and cultures into its ranks."
The Muslim Council of Britain said Mr Robinson "does not represent our armed forces, however much he tries to claim otherwise" and welcomed the "swift statement by the Army in disassociating itself from the far right".