U.S. President Barack Obama said Thursday that the United States will cooperate with Mexico in the fight against drug-trafficking and organized crime in any way the Mexican government deems appropriate. Obama recommitted the United States to combat the demand for illegal drugs and the flow of illegal guns across the its border with Mexico even as Mexico City rethinks how much access it gives to U.S. security agencies. "I agreed to continue our close cooperation on security, even as the nature of that cooperation will evolve," Obama told reporters in Mexico at a joint news conference with Mexican President Enrique Pena Nieto. "It is obviously up to the Mexican people to determine their security structures and how it engages with other nations - including the United States." Pena Nieto has moved to end the widespread access that U.S. security agencies have had in Mexico to help fight drug-trafficking and organized crime. The White House has been cautious in its response to the changes, with Obama and his advisers saying they need to hear directly from the Mexican leader before making a judgment about the new arrangement. Pena Nieto Thursday downplayed the notion that the new arrangement would mean less close cooperation with the United States. "There is no clash between these two goals," Pena Nieto said at the news conference. The Mexican president said that Obama had said the United States will "cooperate on the basis of mutual respect" to promote an efficient security strategy. The two leaders met at Mexico's National Palace on the first day of Obama's three-day trip to Mexico and Costa Rica.