Among those pardoned were 65 people with chronic illnesses or physical handicaps, 167 elderly people, 53 pregnant women or mothers and 417 foreign prisoners.
The pardon was motivated partly by humanitarian considerations and took its inspiration from the "ideals and noble values" of the Mohammed VI foundation for the reintegration of prisoners, the ministry said.
Morocco's total prison population is around 56,000, according to justice ministry officials.
"The releases have already begun and could take as long as a week to be completed," a ministry spokesman said.
Morocco's 53 prisons are often criticised by local human rights groups over their overcrowding and desperate conditions.