Brewer will take office from March 15. She succeeds Stefano Pessina, who will transition to the role of executive chairman of the Walgreens board, the drugstore chain said in a statement.

Pessina served as CEO of the company for six years following the merger of Walgreens and Alliance Boots in December 2014. Walgreens said in July that Pessina was going to step down.

Pessina will replace James Skinner as executive chairman of Walgreens in March. Skinner will remain on the board as a non-executive director to facilitate a leadership transition, the company said.

Prior to joining Starbucks, Brewer served as president and CEO of warehouse chain Sam's Club, a unit of Walmart Inc, where she worked from 2012 to 2017.

Shares of Walgreens rose as much as 9% in extended trade after markets closed.

Starbucks said earlier on Tuesday that Brewer would be leaving next month to take a chief executive officer role at another company. Her appointment at Walgreens was reported first by the Wall Street Journal.

(Reporting by Kanishka Singh in Bengaluru; Editing by Chris Reese)