Mexico's Defense Department says the shootout happened in a remote, mountainous region in Guerrero state, where the Pacific coast resort of Acapulco is located.
The department says soldiers came under fire from a convoy of gunmen Wednesday while patrolling the drug trafficking area.
Obama is meeting Thursday with President Felipe Calderon to show his support for the Mexican government's fight against cartels.
The Defense Department described the shootout Thursday.