They say their human rights were breached when they were given a special nightly menu - drawn up to recognise their specific dietary requirements - by officers at HMP Leeds last month.
More than 200 Muslim inmates at the jail are believed to have been offered the meat which is strictly forbidden by Islam. The sandwich was one of three options on the menu card which was created to cover the religious festival during which Muslims are required to fast during daylight.
They later complained to prison officers on duty but say they were told that the menus had been printed in error.
Yet when they opened the sandwiches, having ordered cheese, some claim they were still filled with boiled ham.
Güncelleme Tarihi: 27 Ekim 2007, 13:33
They are now launching legal action, insisting that their human rights were breached and could each be entitled to up to £10,000 in compensation if they win their case at court.
One Muslim inmate, a 28-year-old who was serving a 16-week sentence for driving whilst disqualified, said: 'When I opened my meal that night I found I'd been given a ham sandwich. I'd asked for cheese.
'It was a breach of my human rights and I want compensation.'
He claimed that some inmates were so hungry they ended up eating the sandwiches.
The prison denied that any Muslim prisoners had been given ham sandwiches but admitted there had been a mistake when the menus were printed.
A spokesman for the Ministry of Justice said: 'An inappropriate menu card was printed during Ramadan. This mistake was rectified immediately.
'Appropriate menu options for the Iftaar evening meal were available throughout Ramadan.
'Prison Service guidelines state that prisoners must have a diet which meets the requirements of their religion.'
It comes as 16 Muslim inmates at Leeds Prison prepare to launch a separate legal case over claims of mistreatment, including being given food that is forbidden by their religion.
They are expected to claim at a hearing next year that they were given meat which was not halal.
Kate Maynard, from law firm Hickman and Rose Solicitors who is representing some of the men, said: 'One of the issues they are worried about is that they were being told food was halal when it wasn't.
'They are taking this to court to try to change conditions in the prison and make conditions better.'
Last year the Prison Service was forced to apologise to Muslim inmates at a category B jail after a kitchen worker was caught throwing ham into halal curries.
Prisoners at HMP Blakenhurst in Worcestershire each received a written apology.
The inmate behind the attack at the prison, which houses 1,070 offenders, was observed throwing tinned ham into curries destined for Muslim inmates and suspended from his job in the kitchen.