The meeting came after US President Donald Trump last week vowed to designate Mexican drug cartels as terrorist organizations, following the massacre of nine women and children from a US-Mexican Mormon family in northern Mexico.
Lopez Obrador -- who rejected Trump's plan, equating it to "interventionism" -- said Barr had been cordial in their closed-door meeting at the presidential palace in Mexico City.
"As a lawyer, he understands that our Constitution requires us to adhere to the principles of development cooperation and non-intervention in foreign policy," the leftist leader wrote on Twitter afterward.
"On that basis we can always work together."
Lopez Obrador had said he planned to raise the issue of gun trafficking from the United States at the joint security cooperation meeting.
Mexico regularly insists the violence of its "drug wars" is a shared problem, fueled by both demand for narcotics in the United States and the black-market flow of American-made weapons south of the border.
Lopez Obrador had earlier told a news conference that he expected the meeting to be "friendly."
He said the two sides would be "reviewing a document that will serve as a reference point," but did not give further details.
The meeting was also attended by the Mexican foreign, defense and navy ministers.
Trump has been talking tough on Mexico's powerful drug cartels since the three Mormon women and six children were brutally murdered on November 4, allegedly by gunmen from the La Linea cartel.
He tweeted after the killings that the US was ready to help Mexico "wage war on the drug cartels."
That, plus his vow to blacklist cartels as terror groups, has fueled fears in Mexico that the US could try to mount a military intervention.
Lopez Obrador, who took office a year ago, is struggling to rein in Mexico's drug-fueled violence.
This year appears on track to break the country's murder record, with 28,741 so far.
jg/jhb/wd