DALLAS -- Months after the horror of the Parkland school shootings in Florida, President Donald Trump stood before cheering members of the National Rifle Association and urged them to elect more Republicans to Congress to defend gun rights.

Trump claimed that Democrats want to "outlaw guns" and said if the nation takes that drastic step, it might as well ban all vans and trucks because they are the new weapons for "maniac terrorists."

"We will never give up our freedom. We will live free and we will die free," Trump said Friday as he tried to rally pro-gun voters for the 2018 congressional elections. "We've got to do great in '18."

Activists energized by shootings at schools, churches and elsewhere are also focused on those elections.

In the aftermath of the February school shootings at Marjory Stoneman Douglas High School, which left 17 dead and many more wounded, Trump had temporarily strayed from gun rights dogma.

During a televised gun meeting with lawmakers in late February, he wagged his finger at a Republican senator and scolded him for being "afraid of the NRA," declaring that he would stand up to the group and finally get results in quelling gun violence. But he later backpedaled on that tough talk.

He was clearly back in the fold at the NRA's annual convention, pledging that Americans' Second Amendment right to bear arms will "never ever be under siege as long as I am your president."

Trump briefly referenced the Parkland shootings in his speech, saying that he "mourned for the victims and their families" and noting that he signed a spending bill that included provisions to strengthen the federal background check system for gun purchases as well as add money to improve school safety.

He also repeated his strong support for "letting highly trained teachers carry concealed weapons."

Trump's speech in Dallas was his fourth consecutive appearance at the NRA's annual convention. His gun comments were woven into a campaign-style speech that touched on the Russia probe, the 2016 campaign, his efforts in North Korea and Iran and his fight against illegal immigration.

In strikingly personal criticism of members of Congress, he decried what he said were terribly weak immigration laws, declaring, "We have laws that were written by people that truly could not love our country."

While the president veered wildly off topic at times -- speaking about entertainer Kanye West's recent support and former Secretary of State John Kerry's bicycle accident three years ago -- he repeatedly returned to the message of the day: his support for the Second Amendment.

Trump said some political advisers had told him attending the NRA convention might be controversial, but, "You know what I said? 'Bye, bye, gotta get on the plane."'

Trump has long enjoyed strong backing from the NRA, which spent about $30 million in support of his presidential campaign. He was introduced by Vice-President Mike Pence, who pointed to his own support for gun rights and accused the news media of failing to tell "the whole story" that "firearms in the hands of law-abiding citizens" make communities safer.

One of the Parkland student survivors, David Hogg, criticized Trump's appearance in advance.

"It's kind of hypocritical of him to go there after saying so many politicians bow to the NRA and are owned by them," Hogg said. "It proves that his heart and his wallet are in the same place."

Back in February, Trump had praised members of the gun lobby as "great patriots" but declared "that doesn't mean we have to agree on everything. It doesn't make sense that I have to wait until I'm 21 to get a handgun, but I can get this weapon at 18." He was referring to the AR-15 the Parkland shooting suspect is accused of using.

Those words rattled some Republicans in Congress and sparked hope among gun-control advocates that, unlike after previous mass shootings, tougher regulations might be enacted.

But after expressing interest in increasing the minimum age to purchase an assault weapon to 21, Trump later declared there was "not much political support" for that. He then pushed off the issue of age restrictions by assigning it to a commission.

Gabrielle Giffords, the former Arizona congresswoman who was shot outside a grocery store during a constituent gathering in 2011, said Trump had "allowed his presidency to be hijacked by gun lobbyists and campaign dollars." She said Trump had "ignored the pleas of young people demanding safer gun laws."

------

Associated Press writer Ken Thomas in Washington contributed.