Pies and pasties have been withdrawn from a number of prisons following the discovery by the Food Standards Agency.
UK Justice Minister Jeremy Wright said the incident was absolutely unacceptable.
Under Islamic law, Muslims are strictly forbidden to eat pork.
The products had been distributed to a number of prisons in England, with no indication that the problem has affected prisoners north of the Border.
Mr Wright said the incident was being investigated as a matter of urgency.
He added: "This is an absolutely unacceptable situation and one which we regret greatly. Clearly this must be distressing for those affected and they can be reassured we are doing everything we can to resolve the situation."
The Ministry of Justice said it commissioned tests after the recent high-profile incidents in which beefburgers sold by some supermarket chains were found to contain horse meat.