When Barack Obama was asked at a recent event in Brazil about the most difficult moment of his presidency, he talked about the slayings of 20 young children at the Sandy Hook Elementary School.

"I had to go comfort the parents," the former president said May 30. "Some of you may be aware that our gun laws in the United States don’t make much sense. Anybody can buy any weapon, any time without much, if any, regulation. They buy it over the internet. They can buy machine guns."

Obama’s summary of American gun laws drew a quick rebuttal in the conservative press. Readers asked us to see how well his words match current law. We found some significant lapses.

His characterization of regulation as "without much, if any," is too loose to be fact-checked, but we can check out what he said specifically about U.S. gun laws. His comment on machine guns is especially off the mark.

"Anybody can buy any weapon at any time."

No, not anybody. Federal law bans many kinds of people from buying weapons. A list by the U.S. Bureau of Alcohol, Tobacco, Firearms and Explosives includes: anyone convicted in any court and sentenced to a year or more in prison; anyone with a dishonorable military discharge; anyone convicted of domestic violence or subject to a court order against harassing or threatening an intimate partner; anyone addicted to a controlled drug or has been committed to a mental institution.

An article in The Federalist, a conservative website, noted that people "under 21 years of age may not purchase handguns from a gun dealer," and those under 18 can’t buy rifles or shotguns.

There is a loophole with the age restriction, though. Informal sales within the same state create the opportunity for a young adult to buy a handgun. As the ATF guide notes, "an individual between 18 and 21 years of age may acquire a handgun from an unlicensed individual who resides in the same state."

"They buy it over the internet."

The bottom line is, people can buy firearms over the internet. Under federal law, it’s all the same, whether a person sells a weapon over the counter or over the web. The same rules apply. If the seller is in the firearms business, he or she must have a federal license and submit all sales for a federal background check. It is not legal to sell a gun to someone who is not allowed to buy one, but not every sale requires a background check that would alert the seller.

If two people live in the same state and the seller isn’t in the firearms business (and federal rules define what that means,) then a gun can change hands without a background check. This issue lies at the heart of the push for universal background checks.

As the Government Accountability Office described it in a 2017 report, potential gun buyers can shop from the websites of "major retailers, online retailers, online auctions and marketplaces, online classified listings, online forums and social media networks, and Dark Web websites."

Most of the internet transactions are perfectly legal, with both parties going through all of the standard regulatory steps. There have been illegal sales over the web. In 2010 for example, a former FBI agent was convicted of selling over 50 firearms online without a license. But except for clandestine "dark web" transactions — operations set up to evade the law — the GAO found that even informal sellers followed federal rules.

Sellers "on gun forums and other classified ads were unwilling to sell a firearm to an individual who appeared to be prohibited from possessing a firearm," the GAO reported.

"They can buy machine guns."

This is highly inaccurate. A machine gun is a fully automatic weapon, meaning one simple motion to squeeze the trigger releases multiple rounds. (See our work on how so-called bump stocks can blur this distinction.)

Under federal law, no one can own or sell a machine gun, with one exception: ones owned before May 19, 1986, which are grandfathered in. And as UCLA law professor Adam Winkler told us, any sale or transfer of an old machine gun requires a special background check and a special license.

Winkler called Obama’s sweeping language on this, "absurd."

"Plenty of weapons are not for sale to just anybody, including the machine guns he refers to, plus hand grenades, shoulder-launched missiles, etc.," Winkler said.

Illegal transactions can occur. The GAO reported that someone sold one of its investigators an "Uzi that the seller said was modified so that it would fire automatically." But Obama was talking about what the law allowed, not whether criminals are able to skirt the law.

People sometimes mistake a machine gun, which is an automatic weapon, for a semi-automatic weapon like an AR-15. CNN’s Don Lemon, for instance, made that error while talking about Second Amendment issues in 2014.

Our ruling

Obama said that in the United States, "anybody can buy any weapon, any time without much, if any, regulation. They buy it over the internet. They can buy machine guns."

The assertion that anybody can buy a weapon flies in the face of the many types of people, from felons to drug abusers to spouse abusers, who may not buy weapons. Internet sales are legal, as he said, and they take place under the same rules that govern other gun sales.

As for machine guns, they are strictly illegal, with the exception under legal controls of models from 1986 and earlier.

Taking the elements of his statement together, we rate this claim Mostly False.

Update: Initially, we did not hear from Obama's office, but after publication, Obama spokesman Eric Schultz sent us links to articles, including one from PolitiFact, that described how people circumvent gun laws. But a plain reading of Obama's words, by us and the firearms legal specialists we reached, is that he was describing current laws, not whether people were breaking them. Our rating remains Mostly False.