Lloyd Blankfein’s Goldman Sachs has found its comfort level with guns.

The bank is playing a key role in Bass Pro Shops’ agreement to buy rival outdoors retailer Cabela’s for $5.5 billion.

Cabela’s derives about 40 percent of its sales from hunting equipment — much of it from guns, like the Savage Arms .22 caliber on sale Wednesday for $449.

“They say that all they are doing is placing the debt,” a source close to the deal said. “But look, they own the interest of a company that makes most of its money from selling guns.”

Goldman is buying $1.8 billion of Bass’ preferred stock to finance the acquisition. The stock will pay a guaranteed 7 percent interest rate — plus give Goldman warrants to purchase stock.

It’s quite a cozy and different feeling for guns than Goldman had in 2009, when the bank was working with private equity firm Cerberus Capital Management on making public America’s biggest gun manufacturer, the Freedom Group.

Goldman had met multiple times with Cerberus head Steven Feinberg and had a dedicated team focused on the offering, a source with direct knowledge of the situation said.

Then, shortly before Freedom filed for the IPO, Goldman walked off, according to the source. “The order went out to stop,” the source said.

In a move unrelated to the Goldman exit, Freedom eventually pulled its public offering.

In 2009, Goldman was fighting an image problem partially because of the money it made from selling questionable mortgages during the housing boom.

In November 2009, Blankfein told a UK paper that Goldman bankers served a social purpose and were doing “God’s work.”

To be sure, there are differences between the Freedom Group and Cabela’s.

Freedom makes firearms, whereas Cabela’s is a retailer with more than 60 percent of its sales unrelated to guns.

Bass Pro Shops, which focuses on fishing, has long tapped Goldman for advice.

Goldman declined comment.