The gun manufacturer Daniel Defense published a statement on its home page after one of its military-style rifles was used in the Texas elementary school shooting.

There was a different message when the pop-up disappeared, and it was a promotion with gold-encased bullets, for a chance to win $15,000 worth of guns.

Daniel Defense, a family-owned business in Georgia that has emerged as a pioneer in an aggressive, boundary-pushing style of weapons marketing and sales, has gained national attention after the Texas shooting.

Some of its advertisements use popular video games like Call of Duty and Star Wars to appeal to teenagers. The company was one of the first to use a direct-to-consumer business model that made buying military gear as simple as ordering from Amazon and paying later in installments, which made expensive weaponry more affordable.

The company's founder and chief executive, Marty Daniel, ridicules gun control proposals and uses publicity stunts to drum up sales.

Daniel Defense is at the forefront of an industry that has grown increasingly aggressive in recent years as it tries to expand beyond its aging, mostly white customer base and resists calls for stronger regulation that seem to intensify after every mass shooting.

Ryan Busse, a former executive at the gun company Kimber who is now an industry critic, said that Daniel Defense is the poster child of aggressive marketing.

He said that the company was telling the story of how the gun industry has become radicalized.

The strategy of Daniel Defense seems to have worked. Its sales have gone up in part because of its success in targeting young customers like the one who shot and killed a teacher in Texas. Mr. Ramos, who was killed by the authorities on Tuesday, was a video game enthusiast and bought his assault rifle from Daniel Defense less than a week after he turned 18.

Mr. Daniel didn't respond to calls or emails. Steve Reed, a spokesman for Daniel Defense, said in a statement that the company was deeply sad by the Texas shooting.

Mr. Daniel is a storytellers who uses a folksy tone to market his company and its guns. He flunked out of Georgia Southern University twice before graduating and starting a company that made garage doors.

ImageMarty Daniel, the founder and chief executive of Daniel Defense.
Marty Daniel, the founder and chief executive of Daniel Defense.Credit...Savannah Morning News
Marty Daniel, the founder and chief executive of Daniel Defense.

He said that his gun company was born out of his poor golf game. Mr. Daniel started shooting at targets with an assault rifle, the type of gun he would later make.

Mr. Daniel couldn't find a way to mount a scope onto his rifle. He began selling an accessory that allowed gun owners to add lights, a range finder and lasers to their rifles.

He got his break in 2002 when he was approached by a representative of the U.S. Special Forces. He won a $20 million contract to make accessories for combat rifles. More deals followed. He won a contract with the British military in 2008.

The company made guns for consumers. Its military ties were the basis of its marketing, which often featured heavily armed fighters. A military-style scope is aimed at passing cars on a city street. There are references to the video game Call of Duty.

Most gun makers didn't market military-style assault weapons to civilians before the 2000s. Tactical military gear and guns were kept away from the general public at the largest industry trade shows. The federal assault weapon ban expired in 2004.

Nick Suplina is a senior vice president at Everytown for Gun Safety, a group that supports gun control.

The Sandy Hook shooting led to an industrywide surge in gun sales, as firearm enthusiasts stocked up, fearing a government crackdown. In an interview with Forbes, Mr. Daniel said that the shooting caused a lot of sales.

Christopher Powell, who worked for Daniel Defense after the shooting, said that the company offered extra overtime to meet demand.

A former Daniel Defense manager said that Mr. Daniel had become distracted by the glamour of marketing the brand and rubbing shoulders with celebrities and politicians. The manager and a former executive who didn't want their names used because they were afraid of legal or professional repercussions voiced their concerns that some of the marketing materials were inappropriate for a company that manufactures deadly weapons.

Children carrying and firing guns were featured in some ads. A man dressed as Santa is smoking a cigar and holding a Daniel Defense rifle two days after Christmas last year.

Some companies are in trouble because of the industry's aggressive marketing. The families of the children killed at the Sandy Hook school settled with the gun maker for $73 million. The families claimed that the assault rifles that the Sandy Hook killer used were marketed in a way that was improper.

Daniel Defense launched a new marketing stunt a year after Sandy Hook.

The National Football League did not allow ads for weapons on its broadcasts. The ad depicted a soldier returning home to his family with ominous music in the background.

The ad was rejected because of the N.F.L. ban on gun ads. According to Daniel Defense, the ad complied with the policy because the company sells products other than guns. Mr. Daniel turned the rejection into a rally cry. He urged viewers to call the N.F.L.

Mr. Powell said that Marty Daniel was at work.

Mr. Daniel and his wife, Cindy, have worked with the National Rifle Association to raise money, sell weapons and beat back calls for gun control.

Mr. Daniel and Ms. Daniel became outspoken supporters of Mr. Trump. Mr. Daniel was a member of the Second Amendment Coalition, which advised Mr. Trump on gun policy.

Mr. Daniel said that the election of Mr. Trump saved our Second Amendment rights. They have given more than $70,000 to the Republicans.

ImageFood vendors, vending machines and tables occupy the area where Daniel Defense was to have its booth at the National Rifle Association convention in Houston this weekend.
Food vendors, vending machines and tables occupy the area where Daniel Defense was to have its booth at the National Rifle Association convention in Houston this weekend.Credit...Michael Wyke/AP
Food vendors, vending machines and tables occupy the area where Daniel Defense was to have its booth at the National Rifle Association convention in Houston this weekend.

Daniel Defense's guns were used in at least one other mass shooting. In the hotel room of the man who killed 59 people at a Las Vegas music festival, there were four semiautomatic rifles.

Mr. Daniel is a critic of gun control. Legislation was backed by the N.R.A. to bolster the federal background-check system after the shooting at the high school. He declared that all firearms laws that limit the rights of law-abiding citizens are unconstitutional.

Josh Sugarmann, executive director of the Violence Policy Center, said that the chief executives of Smith & Wesson or the old-guard gun companies don't have the same kind of boldness.

Daniel Defense is not as large as those rivals. In the most recent year for which government data is available, it manufactured nearly 53,000 guns, giving it a less than 1 percent share of the market.

It has led the way in building a direct-to-consumer sales business, as gun manufacturers try to match the success of other industries in exploiting e-commerce.

Gun companies used to sell their products to stores, which then sold the weapons to customers. Industry experts say that the manufacturers are trying to sell guns and accessories online, targeting consumers with slick ad campaigns. Guns sold online have to be picked up at a licensed firearms dealer who conducts a background check.

Daniel Defense offers a buy-now-pay-later financing option that allows qualified buyers to spread the price over a number of payments. The company's website says the approval takes seconds.

They have been successful at selling the idea.

Daniel Defense saw a surge in gun sales. The company received a $3.1 million loan from the federal Payment Protection Program, which was intended for small businesses at risk of laying off employees.

The week before the Texas shooting, Daniel Defense posted a photograph on Facebook and Twitter, showing a little boy sitting cross-legged, an assault rifle balanced across his lap.

The ad was posted on May 16. Mr. Ramos was 18 years old.

According to the Texas Department of Public Safety, he bought his first gun from a store in Uvalde. The receipt that Mr. Ramos posted on the social media platform Yubo shows that he bought the Daniel Defense rifle for $1,870 three days later.

Daniel Defense retreated from its usual provocative online presence after the shooting. The company did not allow access to its feed. The booth was supposed to be at the N.R.A. convention in Houston.

The $15,000 guns-and-ammo sweepstakes was removed from the home page on Thursday.

Tara Siegel Bernard and Kitty Bennett contributed to the research.