Costco Wholesale Corp. is boosting its membership fees for the first time since 2017, raising the charge for a basic membership to $65 a year from $60.

The 8% price increase for U.S. and Canadian members will take effect Sept. 1, Costco said in a statement Wednesday. The price of the retailer’s premium membership will rise to $130 from $120. The move will affect about 52 million memberships.

Costco shares rose 2.4% at 5:40 p.m. in extended trading in New York. The stock has gained 34% this year through Wednesday’s close, outpacing the advance of the S&P 500 Index.

Investors and analysts have long waited for the Issaquah, Washington-based company to raise its membership price. Costco has typically increased fees every five years or so, prompting analysts in recent quarters to ask about the company’s thinking on the timing.

Executives had said an increase was only a matter of time, and that the company has experienced strong renewal rates, new sign-ups and customer loyalty. On earnings calls, they have acknowledged that an increase has taken longer than usual to materialize.

Jennifer Bartashus, a Bloomberg Intelligence analyst, wrote in a Wednesday note that the fee increase was expected and overdue from Costco’s usual five-year cadence.

“The company delayed an increase amid consumer concerns about inflation and the economic outlook, which have eased some,” she wrote, adding that she expects renewal rates to stay steady after the increase.

U.S. consumers have faced surging prices across the economy in recent years, though increases have started to moderate. Retailers are anticipating inflation will return to more normalized levels of low single digits this year, and have reported drops in some areas, including general merchandise.

Costco’s customer base tends to be more affluent given the company’s membership model, and it has been relatively insulated from the broader pullback in sales growth and discretionary spending across the sector. The company said Wednesday that U.S. comparable sales, excluding gasoline, grew 6.3% in June from a year ago.

Membership income is especially important for Costco, which has used the proceeds to invest in its operations and keep the price of goods down. The higher fees will provide a profit tailwind for Costco, which tries to entice shoppers with low prices on bulk amounts for a relatively narrow assortment of goods. Premium memberships have driven growth, and make up just over half of Costco’s total paid members.

Costco appointed a new chief financial officer earlier this year, hiring Gary Millerchip from Kroger Co. Ron Vachris has served as chief executive officer since January. The company has been adding more stores in the US and overseas, while investing in e-commerce.

The company is following Sam’s Club, owned by Walmart Inc., in raising the price of its membership as U.S. consumers flock to warehouse stores that offer wholesale quantities of goods. Sam’s Club boosted its annual fee to $50 for basic and $110 for premium in 2022, although it used its rewards program to return the extra cost to members during the first year.