If the gun crowd is avoiding Dick's Sporting Goods because of its newly enacted corporate policies restricting some sales, it isn't showing in the bottom line.

First-quarter earnings and sales were higher, defying the predictions of gun rights advocates who said the company would lose significant business from its decision to ban sales of assault-style weapons and enacting a policy requiring gun buyers to be at least 21 years old. The company also hired a Washington, D.C., lobbyist to push for a federal assault weapons ban.

Dick's rankled the National Rifle Association.

The NRA's Institute for Legislative Action has been especially critical of Dick's moves, especially the hiring of the lobbyists.

"It’s entirely possible that the chain realizes it has irrevocably damaged its image among the pro-freedom community, especially with those who take part in outdoor activities," it wrote on its website earlier this month. It went on to say "Dick’s new lobbying venture is likely meant to fully embrace anti-gun advocacy at all levels and through whatever means necessary."

Based on the results, Dick's shares surged Wednesday, up 27% to $38.75 in afternoon trading.

Even Chief Executive Ed Stack was unsure in February how the new policies would affect sales, but warned that some buyers could avoid the store for outdoor and other equipment in the wake of its widely publicized action following the school shootings in Parkland, Florida.

In comments on an earnings conference call, Stack said benefits outweighed the drawbacks. Indeed, hunting sales declined at the stores, but other shoppers who are supporters of the policy have become customers.

"There's definitely been some benefits from people who have joined us because of the policy," Stack said.

Net income in the first quarter was up 3 percent on a 5 percent increase in sales, the company reported on Wednesday.

"Our strong first-quarter earnings reflect improved execution against our merchandising strategy, which results in higher merchandise margins," Stack said in a prepared release. "Product newness, strength in our private brands and a more refined assortment led to a much healthier business, with fewer promotions and cleaner inventory throughout the quarter."

The better results come even as others predicted Dick's, which started as a single store on Binghamton's East Side in 1948, would continue to suffer under pressure from online retailing behemoth Amazon.

The company said online sales increased by 24 percent in the first quarter as it recently realigned its online strategy, bringing the operation in-house after dispatching that segment to a third party for several years. In the first quarter, online sales accounted for 11 percent of overall sales, mainly in footwear and apparel, up from 9 percent a year ago.

First-quarter net income was $60.1 million, 59 cents a share, on sales of $1.9 billion, compared with net income of $58.2 million, 52 cents a share, on sales of $1.8 billion for the same period one year ago.

Same-store sales — sales at stores open for more than a year and a key measure of retailing health — fell by 2.5% compared to the same period one year ago.

The results topped Wall Street expectations. The average estimate of 12 analysts surveyed by Zacks Investment Research was for earnings of 42 cents per share.

The company opened eight new stores in the first quarter, compared to not a single new store opening in the fourth quarter and 25 new stores in the first quarter of 2017. The Pittsburgh-based company now was 724 stores operating under the Dick's brand and 129 stores operating under the Field & Stream and Golf Galaxy brands, with total retail space of 42.1 million square feet.

The Associated Press contributed to this story.