In this paper, the lattice Boltzmann method is used to study the Prandtl number effect on flow structure and heat transfer rates in a magnetohydrodynamic flow mixed convection in a lid-driven cavity filled with a porous medium. The right and left walls are at constant but different temperatures (θh and θc), while the other walls are adiabatic. Gallium and salt water (0.02 < Pr < 13.4) are used as samples of the electroconducting fluids in the cavity. Typical sets of streamlines and isotherms are presented to analyze the flow patterns set up by the competition among the forced flow created by the lid-driven wall, the buoyancy force of the fluid and the magnetic force of the applied magnetic field. Mathematical formulations in the porous media were constructed based on the Brinkman–Forchheimer model, while the multidistribution-function model was used for the magnetic field effect. Numerical results were obtained and the effects of the Prandtl number and the other effective parameters such as Richardson, Hartman, and Darcy numbers were investigated. It was found that the fluid fluctuations within the cavity were reduced by increasing the Hartman number. A similar pattern was observed for the Darcy number reduction. Heat transfer was essentially dominated by the conduction for the low Prandtl number and forced convection dominated as the Prandtl number increased. Also, the average Nusselt number was raised by increasing the Prandtl number. It was discovered that a remarkable heat transfer enhancement of up to 28% could be reached by increasing the Prandtl number (from 0.02 to 13.4) at constant Richardson and Darcy numbers. Copyright © 2011 John Wiley & Sons, Ltd.