(Sharecast News) - Shares in American retail pharmacy chain Walgreens Boots Alliance rose on Thursday despite the company cutting its annual targets due to challenging conditions in the US, as sales in its second quarter came in ahead of expectations.

Guidance for adjusted earnings per share now stands at between $3.20 to $3.35 for the year ending 31 August, the mid-point of which was cut from earlier guidance of $3.20 to $3.50.

The company said was due to a "challenging retail environment" in the US, an early wind-down of its sale-leaseback program for its real estate and lower earnings from pharmaceutical distributor Cencora after a recently sold further shares.

For the second quarter ended 29 February, Walgreens reported a loss of $6.85 per share, significantly higher than the $0.81 loss a year earlier, after the firm was stung by a $5.8bn after-tax non-cash impairment relating to a loss in value of its controlling stake in startup VillageMD.

Excluding this charge, EPS increased 3.4% to $1.20, helped by the first quarter of positive earnings in the US Healthcare division.

Group sales for the second quarter were 6.3% higher than last year at $37.1bn, well ahead of the $35.9bn expected by the market, with sales growth registered across all business segments. The largest division, US Retail Pharmacy, saw 4.7% sales growth to $28.9bn.

"We're encouraged by our first quarter of US Healthcare positive adjusted EBITDA and continued topline growth alongside another quarter of strong execution in pharmacy, as we look to re-energise and evolve its impact both at Walgreens and at large," said chief executive Tim Wenworth.

"As we continue to operate in a challenging retail environment, we are taking actions to focus on customer engagement and value."

Looking ahead, despite the cut to profit guidance, the retailer said it remains confident in achieving its cost-savings target of $1bn this year as it continues to lay off staff, improve efficiency and close struggling stores.

The stock was up more than 2% at $21.46 by 0946 ET.