Democratic presidential candidate Beto O'Rourke said Friday he was open to allowing people to use assault-style weapons like AR-15s and AK-47s at gun ranges and hunting clubs, despite his plan to ban the weapons' purchase and to require owners of existing weapons to sell them to the government.

During a visit to North High School in Des Moines that included a tour and town hall-style school assembly, a student told O'Rourke he has used an AR-15 for hunting deer and asked about how O'Rourke's gun policy would affect people who do.

O'Rourke responded that it was the first time he had heard the case for using an AR-15 to hunt deer, but he said he has heard from Texas ranchers and farmers who use them to fend off feral hogs.

"Perhaps a way to address a legitimate concern or need is to ensure that those who have or want to use an AR-15 are able to keep it at a hunting club or at a gun range so that there is some control and safeguard still placed on that firearm," he said.

"This is why I'm here," he added. "I want to listen to those who feel, perhaps, differently than I do, (and) include their point of view and ideas in whatever becomes the final piece of legislation or the law that we adopt."

Asked about his response by reporters later in the morning, O'Rourke reiterated that it's something he would consider.

"I'm open to the idea of — actually as proposed originally by Congressman Eric Swalwell (D-California) — that in a mandatory buyback there would be places like a gun range or a hunting lodge where you could securely keep an AR-15 or an AK-47. I'm open to it," he said.

Hunters and hunting outlets include reasons and instructions for using AR-15s or AK-47s for deer hunting.

O'Rourke has made advocating for a mandatory ban and buyback of assault weapons a major focus of his campaign, especially after the Aug. 3 shooting that killed 22 and injured dozens in his hometown of El Paso.

His gun safety plan includes creating a nationwide gun licensing system and registry, requiring universal background checks for gun purchases, implementing "red flag" laws, banning the purchase of assault-style weapons and requiring people to sell existing assault-style weapons to the government.

At the September Democratic debate, O'Rourke's remark of "Hell, yes we're going to take your AR-15," elicited strong reactions from his supporters and his critics.

O'Rourke's visit to North High School Friday morning capped a three-day trip to Iowa that included a town hall at Cornell College in Mount Vernon, a roundtable discussion at the Iowa Harm Reduction Coalition Office in Cedar Rapids and a Des Moines town hall hosted by the League of Latin American Citizens and Newsmax TV.

While in Iowa, he released a plan to address substance use disorders and the opioid epidemic.

His Friday-morning school visit included stops in high school government and English classes, followed by a school assembly where his campaign staff said they expected about 300 students to attend. Several students crowded around afterward to snap selfies and ask more direct questions.

Ian Richardson covers Ankeny and Altoona for the Register. Reach him at irichardson@registermedia.com, at 515-284-8254, or on Twitter at @DMRIanR.

Your subscription makes work like this possible. Subscribe today at DesMoinesRegister.com/Deal.